"description": "Get the delivery date for a customer's order. Call this whenever you need to know the delivery date, for example when a customer asks 'Where is my package'",
"parameters": {
"type": "object",
"properties": {
"order_id": {
"type": "string",
"description": "The customer's order ID.",
},
},
"required": ["order_id"],
"additionalProperties": False,
},
}
}
]
messages = [
{"role": "system", "content": "You are a helpful customer support assistant. Use the supplied tools to assist the user."},
{"role": "user", "content": "Hi, can you tell me the delivery date for my order?"}
每个支持 MCP 的软件,都有一个 MCP Server 文件,里面列出了所有支持调用的函数,函数注释里的内容是给 AI 看的,告诉 AI 这个函数是做什么用的。 MCP Server 文件就是给 AI 看的工具说明书。
例如百度地图 MCP 案例:
https://github.com/baidu-maps/mcp/blob/main/src/baidu-map/python/src/mcp_server_baidu_maps/map.py
每个以@mcp.tool()开头的函数,都是一个百度地图支持 MCP 调用的功能。