mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-07-07 06:20:45 +00:00
feat: adding tool annotation used by MCP
This commit is contained in:
parent
929ac618ce
commit
4b1330a84b
9 changed files with 160 additions and 0 deletions
|
@ -843,6 +843,7 @@ class ChatAgent(ShieldRunnerMixin):
|
|||
)
|
||||
for param in tool_def.parameters
|
||||
},
|
||||
annotations=tool_def.annotations,
|
||||
)
|
||||
tool_name_to_args[tool_def.identifier] = toolgroup_to_args.get(toolgroup_name, {})
|
||||
|
||||
|
|
|
@ -665,6 +665,7 @@ class OpenAIResponsesImpl:
|
|||
},
|
||||
"required": [p.name for p in t.parameters if p.required],
|
||||
},
|
||||
annotations=t.annotations,
|
||||
)
|
||||
)
|
||||
else:
|
||||
|
|
|
@ -65,6 +65,7 @@ async def list_mcp_tools(endpoint: str, headers: dict[str, str]) -> ListToolDefs
|
|||
description=param_schema.get("description", ""),
|
||||
)
|
||||
)
|
||||
annotations = getattr(tool, "annotations", None)
|
||||
tools.append(
|
||||
ToolDef(
|
||||
name=tool.name,
|
||||
|
@ -73,6 +74,7 @@ async def list_mcp_tools(endpoint: str, headers: dict[str, str]) -> ListToolDefs
|
|||
metadata={
|
||||
"endpoint": endpoint,
|
||||
},
|
||||
annotations=annotations,
|
||||
)
|
||||
)
|
||||
return ListToolDefsResponse(data=tools)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue