Repository navigation
Conversation
…a URL Adds python/03-integrate/tools/deed-page: a Strands agent with a publish_page tool that publishes an HTML page to deed.page and returns the URL, keeping the API token out of the model's context, plus --no-llm and --delete paths and a remote MCP alternative. Registers it in samples.json.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds
python/03-integrate/tools/deed-page, a small sample for something the tool samples don't cover yet: getting an agent's output in front of someone else. The agent writes a self-contained HTML page (a brief, a report, a status page) and calls one custom tool,publish_page, which publishes it to deed.page and returns a public HTTPS URL. deed.page needs no account or API key to start, so the sample runs with just Bedrock access.A few patterns that might be useful beyond this particular service:
~/.config/deed-page/token(700/600) and reuses it, but only the URL, slug, version and expiry go back to the agent, so the token can't leak into the conversation or into a page.publish_page. Cleanup is a CLI path (--delete <slug>), outside the agent loop.--no-llmexercises the publishing path without a model call, which helps before Bedrock model access is set up.MCPClient(url="https://deed.page/mcp", headers=..., tool_filters={"allowed": ["publish_site", "get_site"]})). It explains why the main script wraps REST instead: a first MCP publish without a token returns the token inside the tool result.Files:
publish_agent.py,README.md(following the use-case README template),requirements.txt,.gitignore, and one new entry insamples.json(only that entry; the generator also wanted to add three unrelated samples that are missing from the manifest, which I left alone).Testing:
ruff checkandbanditare clean. Against the live service I ran:--no-llm --ttl 600: page served (200), token file created with mode 600,--delete→ 404agent.tool.publish_page(...)as a direct Strands tool call → 200 → deleted → 404publish_siteandget_site, and a directpublish_sitecall returned no token when the header was sent → deleted → 404I couldn't run the Bedrock model turn itself (no AWS credentials where I tested), so a quick run of
python publish_agent.py "Write a one-page brief on ..."on your side would be the remaining check.Disclosure: I'm with the deed.page team (Avatar 8 LLC), the service this sample uses. If a vendor sample isn't wanted here, or you'd rather see an issue first, feel free to close this. Docs: https://deed.page/docs. Our MIT agent skill: https://github.com/f-o-x11/deed-page-skill
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.