Query MCP servers, list available MCP tools, get tool schemas, and call MCP tools programmatically. CRITICAL - When user message contains [@mcp:...] mention, you MUST load this skill first to properly use MCP tools.
Query MCP server information, tool lists, and schemas through scripts, and call MCP tools via SDK.
<!--zh ## 核心能力 -->Before calling mcp.call(), you MUST first query and confirm through scripts:
get_tools.py) - REQUIREDget_tool_schema.py) - REQUIREDget_servers.py) - Optional, usually provided in user promptsSTRICTLY FORBIDDEN to call MCP tools based on imagination or experience without querying first. Even if you think a tool "should" exist, you must query to confirm it first.
STRICTLY FORBIDDEN to call the following as tool names:
from sdk.mcp import mcpmcp.callmcp.call()mcp.call() is a Python SDK method that must be executed within Python code using the run_skills_snippet tool.
Wrong Example:
# Wrong! Do NOT do this
tool_call(name="from sdk.mcp import mcp", arguments={})
tool_call(name="mcp.call", arguments={...})
Correct Example:
# Correct! Use run_skills_snippet tool
run_skills_snippet(
python_code="""
from sdk.mcp import mcp
result = mcp.call(...)
"""
)
Scripts use standard command-line arguments, for example:
python scripts/get_servers.pypython scripts/get_tools.py --server-name <服务器名称>In Agent environment, use shell_exec tool to execute scripts:
# 获取服务器列表
shell_exec(
command="python scripts/get_servers.py"
)
# 获取指定服务器的工具列表
shell_exec(
command="python scripts/get_tools.py --server-name <服务器名称>"
)
# 获取工具 Schema
shell_exec(
command="python scripts/get_tool_schema.py --server-name <服务器名称> --tool-name <工具名称>"
)
Important Note: mcp.call() is NOT a standalone tool, but an SDK method called within Python code.
In Agent environment, use run_skills_snippet tool to execute Python code containing mcp.call() (MUST first query and confirm server and tool existence via scripts):
# 使用 run_skills_snippet 工具执行以下 Python 代码
run_skills_snippet(
python_code="""
from sdk.mcp import mcp
result = mcp.call(
server_name="<服务器名称>", # 必须是通过 get_servers.py 查询到的真实服务器名
tool_name="<工具名称>", # 必须是通过 get_tools.py 查询到的真实工具名
tool_params={"参数": "值"} # 必须符合 get_tool_schema.py 返回的 Schema
)
if result.ok:
print(result.content)