Azure-Samples / Azure-Samples/remote-mcp-functions-python

Support _meta in mcp_tool

未关闭
#38 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Python
星标
125
派生
83
PR 合并指标
30 天内没有已合并 PR

描述

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:

```python
@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.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。