SparkGen Tool
Manage MCP tools defined in app/mcp_server.py and config/ai_workflow.yaml.
Dynamic Context
Before any action:
- •Read
app/mcp_server.py— find_define_tools()method for current tool schemas - •Read
config/ai_workflow.yaml— parsetools:section - •If server is running, fetch live tools:
curl -sf http://localhost:8000/v1/tools -H "X-API-Key: ${API_KEY:-dev-local-key}"
Actions
List Tools (/sparkgen-tool list)
Parse app/mcp_server.py _define_tools() and display:
| Name | Description | Parameters | Target |
Also show which agents have each tool assigned (from workflow YAML agents[].tools).
Add Tool (/sparkgen-tool add <name>)
Add a new MCP tool to the project. Modify these files:
- •
Tool schema in
app/mcp_server.py— add to_define_tools():pythonTool( name="<name>", description="<description>", inputSchema={ "type": "object", "properties": { # define parameters }, "required": [...] } ) - •
Handler method in
app/mcp_server.py— addasync def _handle_<name>(self, args)method - •
Call routing in
app/mcp_server.py— add case tocall_tool()method:pythonelif name == "<name>": return await self._handle_<name>(arguments) - •
Workflow entry in
config/ai_workflow.yaml— add totools.tools::yaml- name: <name> target: <target_type> resource: "<resource_id>"
- •
Agent assignment — add tool name to relevant agent(s)
tools:list in workflow YAML - •
Test — add test case in
tests/test_mcp_server.py - •
Validate: Run
make validatethenpytest tests/test_mcp_server.py -v
Test Tool (/sparkgen-tool test <name>)
If server is running:
curl -s -X POST http://localhost:8000/v1/tools/<name>/call \
-H "Content-Type: application/json" \
-H "X-API-Key: ${API_KEY:-dev-local-key}" \
-d '{"arguments": {<test_args>}}'
Otherwise run the unit test: pytest tests/test_mcp_server.py -v -k <name>
Remove Tool (/sparkgen-tool remove <name>)
- •Remove tool schema from
_define_tools()inapp/mcp_server.py - •Remove handler method
_handle_<name> - •Remove case from
call_tool() - •Remove from
tools.tools:in workflow YAML - •Remove from all agent
tools:lists in workflow YAML - •Remove related tests
- •Run
make validate