Skip to content

Add a tool sample: publish agent output to a URL with deed.page - #337

Open
f-o-x11 wants to merge 1 commit into
strands-agents:mainfrom
f-o-x11:add-deed-page
Open

f-o-x11 wants to merge 1 commit into
strands-agents:mainfrom
f-o-x11:add-deed-page

Conversation

@f-o-x11

@f-o-x11 f-o-x11 commented Oct 27, 2026

Copy link
Copy Markdown

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:

  • Keeping a credential out of the model's context. The first publish returns an API token. The tool saves it to ~/.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 yes, delete no. The agent only gets publish_page. Cleanup is a CLI path (--delete <slug>), outside the agent loop.
  • --no-llm exercises the publishing path without a model call, which helps before Bedrock model access is set up.
  • The README also shows the remote MCP route (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 in samples.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 check and bandit are clean. Against the live service I ran:

  • --no-llm --ttl 600: page served (200), token file created with mode 600, --delete → 404
  • agent.tool.publish_page(...) as a direct Strands tool call → 200 → deleted → 404
  • the README's MCP snippet: the filter loaded exactly publish_site and get_site, and a direct publish_site call returned no token when the header was sent → deleted → 404

I 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.

…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant