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
# Each MCP tool needs a schema definition to describe its expected inputs
81
-
# This is how AI assistants know what parameters to provide when using these tools
52
+
# Each MCP tool needs a schema definition to describe its expected inputs.
53
+
# This is how AI assistants know what parameters to provide when using these tools.
54
+
# Tool properties are passed to the @app.mcp_tool_trigger decorator via
55
+
# the `tool_properties` parameter (as a JSON-serialized string).
82
56
83
57
# Properties for the save_snippet tool
84
58
# This tool saves code snippets with their vector embeddings
85
-
tool_properties_save_snippets=[
59
+
tool_properties_save_snippets=ToolPropertyList(
86
60
ToolProperty(_SNIPPET_NAME_PROPERTY_NAME, "string", "A unique name or identifier for the code snippet. Provide this if you have a specific name for the snippet being saved. Essential for identifying the snippet later."),
87
61
ToolProperty(_PROJECT_ID_PROPERTY_NAME, "string", "An identifier for a project to associate this snippet with. Useful for organizing snippets. If omitted or not relevant, it defaults to 'default-project'."),
88
62
ToolProperty(_SNIPPET_PROPERTY_NAME, "string", "The actual code or text content of the snippet. Provide the content that needs to be saved and made searchable."),
89
-
]
63
+
)
90
64
91
65
# Properties for the get_snippet tool
92
66
# This tool retrieves previously saved snippets by name
93
-
tool_properties_get_snippets=[
67
+
tool_properties_get_snippets=ToolPropertyList(
94
68
ToolProperty(_SNIPPET_NAME_PROPERTY_NAME, "string", "The unique name or identifier of the code snippet you want to retrieve. This is required to fetch a specific snippet."),
95
-
]
69
+
)
96
70
97
71
# Properties for the deep_wiki tool
98
72
# This tool generates comprehensive documentation from code snippets
99
-
tool_properties_wiki=[
73
+
tool_properties_wiki=ToolPropertyList(
100
74
ToolProperty(_CHAT_HISTORY_PROPERTY_NAME, "string", "Optional. The preceding conversation history (e.g., user prompts and AI responses). Providing this helps contextualize the wiki content generation. Omit if no relevant history exists or if a general wiki is desired."),
101
75
ToolProperty(_USER_QUERY_PROPERTY_NAME, "string", "Optional. The user's specific question, instruction, or topic to focus the wiki documentation on. If omitted, a general wiki covering available snippets might be generated."),
102
-
]
76
+
)
103
77
104
78
# Properties for the code_style tool
105
79
# This tool generates coding style guides based on existing snippets
106
-
tool_properties_code_style=[
80
+
tool_properties_code_style=ToolPropertyList(
107
81
ToolProperty(_CHAT_HISTORY_PROPERTY_NAME, "string", "Optional. The preceding conversation history (e.g., user prompts and AI responses). This can provide context for the code style analysis or guide generation. Omit if not available or not relevant."),
108
82
ToolProperty(_USER_QUERY_PROPERTY_NAME, "string", "Optional. The user's specific question, instruction, or prompt related to code style. If omitted, a general code style analysis or a default guide might be generated."),
109
-
]
110
-
111
-
# Convert tool properties to JSON for MCP tool registration
112
-
# This is required format for the MCP tool trigger binding
# This is accessible to AI assistants via the MCP protocol
195
-
@app.generic_trigger(
162
+
@app.mcp_tool_trigger(
196
163
arg_name="context",
197
-
type="mcpToolTrigger",
198
-
toolName="save_snippet",
164
+
tool_name="save_snippet",
199
165
description="Saves a given code snippet. It can take a snippet name, the snippet content, and an optional project ID. Embeddings are generated for the content to enable semantic search. The LLM should provide 'snippetname' and 'snippet' when intending to save.",
# This is accessible to AI assistants via the MCP protocol
304
-
@app.generic_trigger(
270
+
@app.mcp_tool_trigger(
305
271
arg_name="context",
306
-
type="mcpToolTrigger",
307
-
toolName="get_snippet",
272
+
tool_name="get_snippet",
308
273
description="Retrieves a previously saved code snippet using its unique name. The LLM should provide the 'snippetname' when it intends to fetch a specific snippet.",
# This is accessible to AI assistants via the MCP protocol
403
-
@app.generic_trigger(
369
+
@app.mcp_tool_trigger(
404
370
arg_name="context",
405
-
type="mcpToolTrigger",
406
-
toolName="code_style",
371
+
tool_name="code_style",
407
372
description="Generates a code style guide. This involves creating content for a new file (e.g., 'code-style-guide.md' to be placed in the workspace root). Optional 'chathistory' and 'userquery' can be supplied to customize or focus the guide; omit them for a general or default style guide.",
# MCP tool for generating comprehensive wiki documentation
498
464
# This is accessible to AI assistants via the MCP protocol
499
-
@app.generic_trigger(
465
+
@app.mcp_tool_trigger(
500
466
arg_name="context",
501
-
type="mcpToolTrigger",
502
-
toolName="deep_wiki",
467
+
tool_name="deep_wiki",
503
468
description="Creates comprehensive 'deep wiki' documentation. This involves generating content for a new wiki file (e.g., 'deep-wiki.md' to be placed in the workspace root), often by analyzing existing code snippets. Optional 'chathistory' and 'userquery' can be provided to refine or focus the wiki content; omit them for a general wiki.",
0 commit comments