| name | sparkgen-tool |
| description | Add, list, test, or remove MCP tools |
| user_invokable | true |
| auto_invokable | true |
| auto_invoke_hint | Invoke when the user discusses tools, MCP, or tool definitions |
| arguments | <add|list|test|remove> [tool-name] |
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 — parse tools: 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():
Tool(
name="<name>",
description="<description>",
inputSchema={
"type": "object",
"properties": {
},
"required": [...]
}
)
-
Handler method in app/mcp_server.py — add async def _handle_<name>(self, args) method
-
Call routing in app/mcp_server.py — add case to call_tool() method:
elif name == "<name>":
return await self._handle_<name>(arguments)
-
Workflow entry in config/ai_workflow.yaml — add to tools.tools::
- 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 validate then pytest 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() in app/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