Skip to content

Conversation

@jlowin
Copy link
Owner

@jlowin jlowin commented Nov 4, 2025

Adds documentation for the meta parameter on call_tool() and call_tool_mcp() (added in PR #2206).

The meta parameter allows clients to send ancillary information alongside requests - useful for observability, debugging, client identification, or any context the server may need beyond tool arguments.

Client usage:

result = await client.call_tool(
    name="send_email",
    arguments={"to": "[email protected]", "subject": "Hello"},
    meta={"trace_id": "abc-123", "request_source": "mobile_app"}
)

Server access:

@mcp.tool
def send_email(to: str, subject: str, ctx: Context) -> str:
    meta = ctx.request_context.meta
    if meta:
        trace_id = meta.trace_id if hasattr(meta, 'trace_id') else None
        # Use metadata for logging, observability, etc.
    return f"Email sent to {to}"

Documentation is intentionally neutral about use cases - the structure and usage of meta is application-dependent.

@marvin-context-protocol marvin-context-protocol bot added documentation Updates to docs, examples, or guides. Primary change is documentation-related. client Related to the FastMCP client SDK or client-side functionality. labels Nov 4, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 4, 2025

Walkthrough

This pull request adds documentation and docstring updates for a new meta parameter in tool calls. The meta parameter enables clients to send metadata with tool calls that becomes accessible server-side via ctx.request_context.meta. Changes include a new "Sending Metadata" section in the client tools documentation, a "Client Metadata" section in the server context documentation (both marked with VersionBadge 2.13.1), and updated parameter docstrings in the client implementation explaining the meta parameter's purpose and server-side accessibility.

Possibly related issues

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title accurately summarizes the main change: adding documentation for the client meta parameter across documentation files and code docstrings.
Description check ✅ Passed The description explains the purpose of the meta parameter, provides clear client and server usage examples, and notes the intentionally neutral documentation approach. However, it does not include the contributors checklist or review checklist sections from the template.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch docs/client-meta-parameter

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5747cb6 and 40421a8.

📒 Files selected for processing (3)
  • docs/clients/tools.mdx (1 hunks)
  • docs/servers/context.mdx (1 hunks)
  • src/fastmcp/client/client.py (2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
docs/**/*.mdx

📄 CodeRabbit inference engine (docs/.cursor/rules/mintlify.mdc)

docs/**/*.mdx: Use clear, direct language appropriate for technical audiences
Write instructions and procedures in second person ("you")
Use active voice over passive voice
Use present tense for current states and future tense for outcomes
Maintain consistent terminology across the documentation
Keep sentences concise while preserving necessary context
Use parallel structure in lists, headings, and procedures
Lead with the most important information (inverted pyramid)
Use progressive disclosure: basic concepts before advanced ones
Break complex procedures into numbered steps
Include prerequisites and context before instructions
Provide expected outcomes for each major step
End sections with next steps or related information
Use descriptive, keyword-rich headings for navigation and SEO
Focus on user goals and outcomes rather than system features
Anticipate common questions and address them proactively
Include troubleshooting for likely failure points
Offer multiple pathways when appropriate (beginner vs advanced) and provide an opinionated recommended path
Use for supplementary information that supports the main content
Use for expert advice, shortcuts, or best practices
Use for critical cautions, breaking changes, or destructive actions
Use for neutral background or contextual information
Use to confirm success or completion
Provide single code examples using fenced code blocks with language (and filename when relevant)
Use to present the same concept in multiple languages
For API docs, use to show requests
For API docs, use to show responses
Use and to document procedures and sequential instructions
Use and for platform-specific or alternative approaches
Use / for supplementary content that might interrupt flow
In API docs, use for parameters (path, body, query, header) with type and required/default as appropria...

Files:

  • docs/clients/tools.mdx
  • docs/servers/context.mdx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Run tests: Python 3.10 on windows-latest
🔇 Additional comments (4)
docs/servers/context.mdx (1)

316-343: Excellent documentation of the client metadata feature.

The new "Client Metadata" section is well-written, clearly explains the purpose and accessibility of the meta parameter, and provides a realistic, safe example using hasattr() checks. The documentation correctly emphasizes that metadata structure is application-determined, positioning it as a flexible, neutral mechanism. Consistent version badge (2.13.1) with client-side documentation.

src/fastmcp/client/client.py (2)

895-898: Clear meta parameter documentation in call_tool_mcp.

The docstring correctly describes meta as additional metadata for contextual information, distinguishes it from tool arguments, and documents server-side accessibility via context.request_context.meta. Consistent with call_tool documentation below.


941-944: Clear meta parameter documentation in call_tool.

The docstring mirrors call_tool_mcp and clearly explains the meta parameter's purpose, proper usage, and server-side accessibility. Documentation is consistent and aligns with the feature described in the server-side context documentation.

docs/clients/tools.mdx (1)

104-128: Clear, user-focused documentation of the meta parameter.

The new "Sending Metadata" section fits well after "Advanced Execution Options," explains the purpose clearly with concrete examples (trace_id, request_source), and maintains consistency with server-side documentation. The cross-reference to Client Metadata provides good navigation. VersionBadge 2.13.1 aligns with the feature version across all documentation.

Please verify that the cross-reference anchor #client-metadata correctly maps to the h4 heading "#### Client Metadata" in docs/servers/context.mdx (line 316). Mintlify typically auto-slugifies headings to lowercase with dashes, so this should work, but confirm the anchor resolves correctly.


Comment @coderabbitai help to get the list of available commands and usage tips.

@jlowin jlowin merged commit a359b0b into main Nov 4, 2025
14 checks passed
@jlowin jlowin deleted the docs/client-meta-parameter branch November 4, 2025 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

client Related to the FastMCP client SDK or client-side functionality. 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.

2 participants