You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"description": "Get a list of all available tools in the MCP server.",
11
-
"parameters": {}
12
-
},
13
-
"add_tool": {
14
-
"description": "Add a new tool to the MCP server.",
15
-
"parameters": {
16
-
"name": "Name of the tool (required)",
17
-
"code": "Python code implementing the tool function (required)",
18
-
"description": "Description of what the tool does (required)",
19
-
"param_descriptions": "Dictionary of parameter names to descriptions (optional)"
20
-
}
21
-
},
22
-
"call_tool": {
23
-
"description": "Call a registered tool with the given arguments.",
24
-
"parameters": {
25
-
"name": "Name of the tool to call (required)",
26
-
"args": "Dictionary of arguments to pass to the tool"
27
-
}
28
-
}
29
-
}
9
+
built_in_tools: List[MCPTool] = [
10
+
MCPTool(
11
+
name="add_tool",
12
+
description="Add a new tool to the MCP server by providing its Python code.",
13
+
inputSchema={
14
+
"type": "object",
15
+
"properties": {
16
+
"name": {"type": "string", "description": "Name of the tool"},
17
+
"code": {
18
+
"type": "string",
19
+
"description": "Python code implementing the tool's function. Must define a function with the specified 'name'. Type hints in the function signature for the input schema.",
20
+
},
21
+
"description": {
22
+
"type": "string",
23
+
"description": "Description of what the tool does",
24
+
},
25
+
"inputSchema": {
26
+
"type": "object",
27
+
"description": "JSON schema object describing the parameters the new tool expects (optional). This schema will be returned by get_tools and used for documentation.",
28
+
},
29
+
},
30
+
"required": ["name", "code", "description"],
31
+
},
32
+
),
33
+
MCPTool(
34
+
name="call_tool",
35
+
description="Call a registered dynamic tool with the given arguments.",
36
+
inputSchema={
37
+
"type": "object",
38
+
"properties": {
39
+
"name": {
40
+
"type": "string",
41
+
"description": "Name of the dynamic tool to call",
42
+
},
43
+
"args": {
44
+
"type": "object",
45
+
"description": "Dictionary of arguments to pass to the tool. Must conform to the dynamic tool's inferred JSON input schema.",
"""Add a new tool to the MCP server by providing its Python code.
105
126
106
127
Args:
107
-
name: Name of the tool
108
-
code: Python code implementing the tool function
109
-
description: Description of what the tool does
110
-
param_descriptions: Dictionary of parameter names to descriptions
128
+
name: Name of the tool (required)
129
+
code: Python code implementing the tool's function. Must define a function with the specified 'name'. Type hints in the function signature will be used to infer the input schema. (required)
130
+
description: Description of what the tool does (required)
131
+
inputSchema: JSON schema object describing the parameters the new tool expects (optional). This schema will be returned by get_tools and used for documentation.
0 commit comments