Skip to content

Fix documentation to use 'meta' instead of '_meta' for MCP spec field#2735

Merged
jlowin merged 1 commit intomainfrom
fix/docs-meta-field-naming
Dec 26, 2025
Merged

Fix documentation to use 'meta' instead of '_meta' for MCP spec field#2735
jlowin merged 1 commit intomainfrom
fix/docs-meta-field-naming

Conversation

@jlowin
Copy link
Copy Markdown
Member

@jlowin jlowin commented Dec 26, 2025

The MCP specification uses meta as the field name, not _meta. While the Python SDK's Pydantic models use _meta as a serialization alias, the Python attribute is meta. This PR updates all documentation to consistently refer to meta when discussing the MCP specification and uses meta in code examples.

Additionally removes unnecessary hasattr checks from meta field examples, since meta is a standard field on MCP SDK objects (it's just optional/None).

Changes:

  • Updated server docs to say "passed through as the meta field" instead of "_meta field"
  • Updated client docs to say "The meta field is part of the standard MCP specification"
  • Fixed code examples to use .meta instead of ._meta
  • Removed hasattr checks from meta field examples

Example:

# Before
if hasattr(resource, '_meta') and resource._meta:
    fastmcp_meta = resource._meta.get('_fastmcp', {})

# After  
if resource.meta:
    fastmcp_meta = resource.meta.get('_fastmcp', {})

@jlowin jlowin added the documentation Updates to docs, examples, or guides. Primary change is documentation-related. label Dec 26, 2025
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Dec 26, 2025

Walkthrough

This pull request updates documentation across client and server files to reference a public meta attribute instead of a private _meta attribute for accessing FastMCP metadata. Changes span prompts, resources, and tools documentation, updating code examples and descriptive text to reflect the new metadata access pattern (e.g., meta._fastmcp.tags instead of _meta._fastmcp.tags). The modifications are purely documentation-focused with no changes to exported or public entity declarations.

Possibly related PRs

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: updating documentation to use 'meta' instead of '_meta' for the MCP specification field across multiple files.
Description check ✅ Passed The description provides clear context about the change (MCP spec field naming), includes specific examples before/after, lists the changes made, and addresses the contributors checklist; however, most checklist items are unchecked.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/docs-meta-field-naming

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9f5a177 and 83b20d5.

📒 Files selected for processing (7)
  • docs/clients/prompts.mdx
  • docs/clients/resources.mdx
  • docs/clients/tools.mdx
  • docs/integrations/openapi.mdx
  • docs/servers/prompts.mdx
  • docs/servers/resources.mdx
  • docs/servers/tools.mdx
🧰 Additional context used
📓 Path-based instructions (3)
docs/**/*.mdx

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

docs/**/*.mdx: Use clear, direct language appropriate for technical audiences
Write in second person ('you') for instructions and procedures in MDX documentation
Use active voice over passive voice in MDX technical documentation
Employ present tense for current states and future tense for outcomes in MDX documentation
Maintain consistent terminology throughout all MDX documentation
Keep sentences concise while providing necessary context in MDX documentation
Use parallel structure in lists, headings, and procedures in MDX documentation
Lead with the most important information using inverted pyramid structure in MDX documentation
Use progressive disclosure in MDX documentation: present basic concepts before advanced ones
Break complex procedures into numbered steps in MDX documentation
Include prerequisites and context before instructions in MDX documentation
Provide expected outcomes for each major step in MDX documentation
End sections with next steps or related information in MDX documentation
Use descriptive, keyword-rich headings for navigation and SEO in MDX documentation
Focus on user goals and outcomes rather than system features in MDX documentation
Anticipate common questions and address them proactively in MDX documentation
Include troubleshooting for likely failure points in MDX documentation
Provide multiple pathways (beginner vs advanced) but offer an opinionated path to avoid overwhelming users in MDX documentation
Always include complete, runnable code examples that users can copy and execute in MDX documentation
Show proper error handling and edge case management in MDX code examples
Use realistic data instead of placeholder values in MDX code examples
Include expected outputs and results for verification in MDX code examples
Test all code examples thoroughly before publishing in MDX documentation
Specify language and include filename when relevant in MDX code examples
Add explanatory comments for complex logic in MDX code examples
Document all API...

Files:

  • docs/clients/tools.mdx
  • docs/servers/prompts.mdx
  • docs/integrations/openapi.mdx
  • docs/clients/resources.mdx
  • docs/clients/prompts.mdx
  • docs/servers/resources.mdx
  • docs/servers/tools.mdx
docs/**/*.{md,mdx,json}

📄 CodeRabbit inference engine (AGENTS.md)

Documentation uses Mintlify framework. Files must be in docs.json to be included. Never modify docs/python-sdk/** (auto-generated)

Files:

  • docs/clients/tools.mdx
  • docs/servers/prompts.mdx
  • docs/integrations/openapi.mdx
  • docs/clients/resources.mdx
  • docs/clients/prompts.mdx
  • docs/servers/resources.mdx
  • docs/servers/tools.mdx
docs/**/*.{md,mdx}

📄 CodeRabbit inference engine (AGENTS.md)

docs/**/*.{md,mdx}: Code examples in documentation must explain before showing code and make blocks fully runnable (include imports)
Documentation structure: Headers form navigation guide with logical H2/H3 hierarchy. Content should be user-focused with sections motivating features (why) before mechanics (how). Use prose over code comments for important information
Never use 'This isn't...' or 'not just...' constructions in writing - state what something IS directly. Avoid defensive writing patterns

Files:

  • docs/clients/tools.mdx
  • docs/servers/prompts.mdx
  • docs/integrations/openapi.mdx
  • docs/clients/resources.mdx
  • docs/clients/prompts.mdx
  • docs/servers/resources.mdx
  • docs/servers/tools.mdx
🧠 Learnings (5)
📚 Learning: 2025-11-26T21:51:44.174Z
Learnt from: CR
Repo: jlowin/fastmcp PR: 0
File: .cursor/rules/core-mcp-objects.mdc:0-0
Timestamp: 2025-11-26T21:51:44.174Z
Learning: When implementing changes that affect MCP object types (Tools, Resources, Resource Templates, or Prompts), such as adding tags or importing, ensure changes are adopted, applied, and tested on all four object types

Applied to files:

  • docs/clients/resources.mdx
  • docs/servers/resources.mdx
📚 Learning: 2025-11-26T21:52:08.947Z
Learnt from: CR
Repo: jlowin/fastmcp PR: 0
File: docs/.cursor/rules/mintlify.mdc:0-0
Timestamp: 2025-11-26T21:52:08.947Z
Learning: Applies to docs/**/*.mdx : Use ParamField component for API parameters and ResponseField component for API responses in MDX API documentation

Applied to files:

  • docs/servers/resources.mdx
📚 Learning: 2025-11-26T21:52:08.947Z
Learnt from: CR
Repo: jlowin/fastmcp PR: 0
File: docs/.cursor/rules/mintlify.mdc:0-0
Timestamp: 2025-11-26T21:52:08.947Z
Learning: Applies to docs/**/*.mdx : Maintain consistent terminology throughout all MDX documentation

Applied to files:

  • docs/servers/resources.mdx
  • docs/servers/tools.mdx
📚 Learning: 2025-11-26T21:52:08.947Z
Learnt from: CR
Repo: jlowin/fastmcp PR: 0
File: docs/.cursor/rules/mintlify.mdc:0-0
Timestamp: 2025-11-26T21:52:08.947Z
Learning: Applies to docs/**/*.mdx : Document all API parameters including optional ones with clear descriptions in MDX API documentation

Applied to files:

  • docs/servers/tools.mdx
📚 Learning: 2025-11-26T21:52:08.947Z
Learnt from: CR
Repo: jlowin/fastmcp PR: 0
File: docs/.cursor/rules/mintlify.mdc:0-0
Timestamp: 2025-11-26T21:52:08.947Z
Learning: Applies to docs/**/*.mdx : Add appropriate warnings for destructive or security-sensitive actions in MDX documentation

Applied to files:

  • docs/servers/tools.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). (4)
  • GitHub Check: Run tests: Python 3.13 on ubuntu-latest
  • GitHub Check: Run tests: Python 3.10 on ubuntu-latest
  • GitHub Check: Run tests: Python 3.10 on windows-latest
  • GitHub Check: Run tests with lowest-direct dependencies
🔇 Additional comments (7)
docs/servers/tools.mdx (1)

115-115: Documentation wording improvement looks good.

The updated description correctly identifies meta as the client-side field name and provides clearer context about where this data is passed through.

docs/servers/resources.mdx (1)

131-131: Documentation updates are accurate and consistent.

Both descriptions correctly reference the meta field as used by MCP clients, maintaining consistency across the resource documentation.

Also applies to: 173-173

docs/servers/prompts.mdx (1)

110-110: Documentation terminology updates are consistent.

The changes correctly update field references from _meta to meta, maintaining consistency with the other server documentation files.

Also applies to: 244-244

docs/clients/tools.mdx (1)

29-31: Simplified meta access pattern is cleaner.

The removal of hasattr checks makes the code more concise, relying on the fact that meta is a standard field on MCP SDK objects (even if None). The if tool.meta: pattern correctly handles both None and falsy cases.

As per coding guidelines, verify these code examples are tested to ensure they're runnable.

Also applies to: 47-49

docs/clients/prompts.mdx (1)

29-31: Documentation and code examples correctly updated.

The changes consistently apply the new meta field access pattern across listing, filtering, and explanatory text. The updated note accurately reflects the new field path (meta._fastmcp.tags).

Also applies to: 47-49, 56-56

docs/integrations/openapi.mdx (1)

327-327: OpenAPI integration documentation correctly updated.

Both the descriptive text and code example now consistently reference the meta field, maintaining alignment with the other client documentation updates.

Also applies to: 347-349

docs/clients/resources.mdx (1)

38-40: Resource documentation comprehensively updated.

All code examples and explanatory text consistently use the new meta field access pattern. The changes maintain parallel structure with the prompts and tools documentation, ensuring a consistent developer experience across all MCP object types.

Based on learnings, when implementing changes that affect MCP object types, ensure changes are adopted across all four object types (Tools, Resources, Resource Templates, and Prompts). This PR demonstrates good consistency in that regard.

Also applies to: 57-59, 75-77, 84-84


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@jlowin jlowin merged commit 4de06d7 into main Dec 26, 2025
13 checks passed
@jlowin jlowin deleted the fix/docs-meta-field-naming branch December 26, 2025 02:05
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.

1 participant