Skip to content

Additional Tool Transformation Examples for Client Wrapping#2002

Merged
jlowin merged 1 commit into
mainfrom
claude/issue-1878-20251004-0236
Oct 4, 2025
Merged

Additional Tool Transformation Examples for Client Wrapping#2002
jlowin merged 1 commit into
mainfrom
claude/issue-1878-20251004-0236

Conversation

@strawgate
Copy link
Copy Markdown
Collaborator

Adds comprehensive documentation showing how to expose Python client methods directly as MCP tools using Tool Transformation.

This addresses the enhancement request in #1878 by adding three progressive examples demonstrating:

  1. Basic client method wrapping - Shows how to wrap a GitHub client method with Tool.from_function() and Tool.from_tool()
  2. Hiding client-specific arguments - Demonstrates hiding internal parameters like debug flags and auth tokens
  3. Reusable argument patterns - Full example showing how to scale this pattern across multiple tools with shared transformations

This pattern eliminates boilerplate wrapper functions and treats tools as annotation layers around client methods, making it easier to:

  • Keep implementation logic in the client
  • Maintain consistent annotations across tools
  • Scale to larger numbers of tools
  • Avoid maintaining duplicate implementations

Closes #1878

Generated with Claude Code

@strawgate strawgate changed the title Additional Tool Transformation Examples Additional Tool Transformation Examples for Client Wrapping Oct 4, 2025
@marvin-context-protocol marvin-context-protocol Bot added the documentation Updates to docs, examples, or guides. Primary change is documentation-related. label Oct 4, 2025
Copy link
Copy Markdown
Member

@jlowin jlowin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great!

@jlowin jlowin merged commit 05dc0f4 into main Oct 4, 2025
15 checks passed
@jlowin jlowin deleted the claude/issue-1878-20251004-0236 branch October 4, 2025 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Updates to docs, examples, or guides. Primary change is documentation-related.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add more Transformation Examples

2 participants