Skip to content

Support _meta in mcp_tool #38

Open

Description

Description
Currently, the @mcp_tool decorator only supports static metadata defined at registration. However, the MCP Protocol supports a _meta object within the tools/call request parameters. This field is essential for passing dynamic, request-scoped context.

In the current Azure Functions implementation, this _meta information is dropped and is not accessible via func.MCPToolContext.

Observed Behavior
When a client sends a tool call with a _meta block:

{ "method": "tools/call", "params": { "name": "get_job_appointment_details", "arguments": {}, "_meta": { "progressToken": 1, "tenant_id": "123", "user_id": "466", "appointment_id": "789" } } }
And the function is defined as:

@mcp_job.function_name("mcp_get_job_appointment_details")
@mcp_job.mcp_tool()
def get_job_appointment_details(context: func.MCPToolContext):

The context object contains transport headers and basic tool info, but the _meta fields (like tenant_id or appointment_id) are missing entirely from the payload.

Expected Behavior
The MCPToolContext should be updated to include a meta property (or similar) that captures the _meta object from the MCP request. This would allow developers to perform multi-tenant lookups or telemetry tracking based on the caller's specific context.

Activity

  1. lilyjma commented on Mar 18, 2026

    @lilyjma
    Contributor

    Swapnil Nagar (@swapnil-nagar) / hallvictoria - we should consider this

  2. hallvictoria commented on Mar 18, 2026

    @hallvictoria
    Contributor

    Hi Lily Ma (@lilyjma) - duplicate issue - will be addressed in Azure/azure-functions-python-library#318

  3. lilyjma commented on May 5, 2026

    @lilyjma
    Contributor

    Tianyu Qiu (@newhardwarefound) this should be addressed and released now in the latest beta package. hallvictoria is working on a sample for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions