suggest_tool_for_task
Matches a natural-language task description to relevant grandMA2 MCP tools using semantic similarity, with keyword fallback when embeddings are unavailable.
Instructions
Suggest MCP tools for a natural-language task description (SAFE_READ).
Embeds the task description and finds the closest tools by cosine
similarity against stored docstring embeddings. Falls back to keyword
matching when using the zero-vector provider or when no embedding token
is available.
Args:
task_description: What you want to accomplish (e.g. "fade out all fixtures").
top_n: Number of suggestions to return (default 3).
provider: Embedding provider — "zero" (keyword fallback) or "github".
Overridden by ``prefer_semantic`` when a token is available.
prefer_semantic: When True (default), automatically use embedding-based
search if GITHUB_MODELS_TOKEN is set in the environment. Falls back
to keyword matching with a ``warning`` field when no token is present.
Set to False to force keyword matching regardless of token availability.
Returns:
str: JSON array of suggested tools with scores and descriptions.
Includes a top-level ``warning`` key when semantic search was
requested but fell back to keyword matching.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"task_description": "<task_description>"
},
"name": "suggest_tool_for_task"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| top_n | No | ||
| provider | No | zero | |
| prefer_semantic | No | ||
| task_description | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |