Dynamic Tool Description based on Route Variable in path

未关闭
#758 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
csharp
领域
api, backend

调研方向

首先检查 C# MCP SDK 的路由处理和工具列表响应生成;该 issue 未指定具体的文件或测试。比较所请求的 /{routeVariable1}/mcp/tools/list 示例,并确定路由上下文可能影响工具描述的位置。完成的标准是确定此模式是否受支持,并记录或演示实现路径。

由索引模型根据 Issue 内容生成。

描述

enhancement needs confirmation

Is your feature request related to a problem? Please describe.

We're trying to create an MCP Server Tool on an asp.net server using this SDK.
As a part of this- we'd like a way to support dynamic descriptions of an mcp tool based on a route variable in the path.
Example-
Request path - /{routeVariable1}/mcp
For the tool list call- we'd like to have a tool description generated based on the value of the routeVariable1. A method call like GetToolDescription(IHttpContext context) => "This is the description for {context.GetRouteVariable["routeVariable1"]} tool.

Sample request/responses
Example 1
/routevariable1/mcp/tools/list
--> returns "This is the description for routevariable1 tool.
Example 2
/routevariable2/mcp/tools/list
--> returns "This is the description for routevariable2 tool.
Is the above pattern supported by the C# MCP SDK?
If yes, could you point me to a sample of how we could implement this?

主要语言
C#
星标
4.5k
派生
814
平均合并
9 天 19 小时
30 天内合并 PR
4

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

modelcontextprotocol/csharp-sdk 的其他 Issue

查看 modelcontextprotocol/csharp-sdk 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

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