Skip to content

Commit faf69d2

Browse files
committed
Improve MCP tool metadata for directories
1 parent 3eeaea2 commit faf69d2

2 files changed

Lines changed: 16 additions & 16 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "psycgod-sage"
7-
version = "2.4.19"
7+
version = "2.4.20"
88
description = "Local-first command wrapper for AI coding agents with compressed terminal output and privacy-safe proof metrics."
99
readme = "README.md"
1010
requires-python = ">=3.10"

src/sage/mcp/tools.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@
3333
},
3434
{
3535
"name": "sage_explain_error",
36-
"description": "Get AI-friendly explanation of command error",
36+
"description": "Get a structured explanation of why a command failed. Returns {error_type, summary, root_cause, affected_files, suggestions}. Use to understand failures before attempting fixes. Parses common error patterns: compiler errors, test failures, permission denied, missing dependencies, syntax errors. Read-only, no side effects. Differs from sage_suggest_fix: this explains the problem; sage_suggest_fix provides fix commands. Use this first to understand, then sage_agentic_fix to get a fix.",
3737
"inputSchema": {
3838
"type": "object",
3939
"properties": {
4040
"command_id": {
4141
"type": "integer",
42-
"description": "Specific command ID (optional, defaults to last failed)"
42+
"description": "Run ID of the failed command (omit to analyze most recent failed command)"
4343
}
4444
}
4545
}
@@ -59,26 +59,26 @@
5959
},
6060
{
6161
"name": "sage_spawn_agent",
62-
"description": "Spawn specialized agent for task",
62+
"description": "Spawn a specialized sub-agent for a focused task. Returns {agent_id, status, result} when complete. Agent types: 'code' for implementation/refactoring, 'test' for writing/running tests, 'debug' for investigating failures, 'security' for vulnerability scanning, 'performance' for profiling/optimization. Use when a task benefits from focused expertise. The spawned agent runs in the same SAGE session and has access to command history. Side effects: agent may execute commands and modify files based on task. Agents run synchronously and return when complete.",
6363
"inputSchema": {
6464
"type": "object",
6565
"properties": {
6666
"agent_type": {
6767
"type": "string",
6868
"enum": ["code", "test", "debug", "security", "performance"],
69-
"description": "Type of agent to spawn"
69+
"description": "Specialization: code (implement), test (verify), debug (investigate), security (scan), performance (optimize)"
7070
},
7171
"task": {
7272
"type": "string",
73-
"description": "Task description for the agent"
73+
"description": "Natural language description of what the agent should accomplish"
7474
}
7575
},
7676
"required": ["agent_type", "task"]
7777
}
7878
},
7979
{
8080
"name": "sage_run_workflow",
81-
"description": "Execute workflow pipeline",
81+
"description": "Execute a named workflow pipeline (test, ci, deploy, or custom). Use when running multi-step automated sequences defined in YAML. Returns {success, steps: [{name, status, duration_ms, output}], total_duration_ms}. Side effects: executes commands defined in workflow, may modify files. Errors: throws WorkflowNotFound if name invalid, YAMLParseError if file malformed. Prefer over manual multi-command sequences for reproducible CI/CD tasks.",
8282
"inputSchema": {
8383
"type": "object",
8484
"properties": {
@@ -95,18 +95,18 @@
9595
},
9696
{
9797
"name": "sage_get_history",
98-
"description": "Get command history",
98+
"description": "Retrieve recent command execution history from SAGE's SQLite database. Returns [{run_id, command, exit_code, duration_ms, timestamp, compression_ratio}]. Use to review what commands ran, find a run_id for sage_show_raw or sage_explain_error, or analyze patterns in failures. Set failed_only=true to filter to non-zero exit codes only. Read-only, no side effects. Prefer over shell history for accurate timing and compression metrics.",
9999
"inputSchema": {
100100
"type": "object",
101101
"properties": {
102102
"limit": {
103103
"type": "integer",
104-
"description": "Number of commands to retrieve",
104+
"description": "Number of recent commands to retrieve (most recent first)",
105105
"default": 10
106106
},
107107
"failed_only": {
108108
"type": "boolean",
109-
"description": "Only show failed commands",
109+
"description": "Filter to commands with non-zero exit code only",
110110
"default": False
111111
}
112112
}
@@ -143,13 +143,13 @@
143143
},
144144
{
145145
"name": "sage_call",
146-
"description": "Run a command as an explicit agent tool-call with purpose metadata (tracked for tool-quality metrics).",
146+
"description": "Run a command with explicit purpose tagging for analytics. Use instead of sage_run_command when you want to track WHY commands are run (read/search/test/build/deploy/audit). Returns same output as sage_run_command plus {purpose, agent} metadata. The purpose tag feeds SAGE's ML predictor to learn which command types fail in this repo. No side effects beyond command execution. Use 'read' for cat/head/tail, 'search' for grep/find, 'test' for pytest/jest, 'build' for make/npm build, 'deploy' for deployment scripts, 'audit' for security scans.",
147147
"inputSchema": {
148148
"type": "object",
149149
"properties": {
150-
"command": {"type": "string", "description": "Command to execute"},
151-
"purpose": {"type": "string", "enum": ["read", "search", "test", "build", "deploy", "audit", "unknown"], "default": "unknown"},
152-
"agent": {"type": "string", "description": "Calling agent name", "default": "mcp"}
150+
"command": {"type": "string", "description": "Shell command to execute"},
151+
"purpose": {"type": "string", "enum": ["read", "search", "test", "build", "deploy", "audit", "unknown"], "description": "Why this command is being run - improves ML failure prediction", "default": "unknown"},
152+
"agent": {"type": "string", "description": "Name of the calling agent for multi-agent tracking", "default": "mcp"}
153153
},
154154
"required": ["command"]
155155
}
@@ -232,11 +232,11 @@
232232
},
233233
{
234234
"name": "sage_agentic_fix",
235-
"description": "Get an auto-fix suggestion for the last failed command. Returns the fix command, strategy, and confidence.",
235+
"description": "Get an auto-fix suggestion for a failed command. Analyzes the error output and returns {fix_command, strategy, confidence, explanation}. Use after a command fails to get a ready-to-run fix. Differs from sage_suggest_fix: this returns a single best fix with confidence score; sage_suggest_fix returns multiple options. Read-only - does NOT execute the fix (use sage_agentic_run for auto-apply). Confidence is 0.0-1.0; values >0.8 are high-confidence fixes. Returns null if no fix can be determined.",
236236
"inputSchema": {
237237
"type": "object",
238238
"properties": {
239-
"command_id": {"type": "integer", "description": "Specific command ID (optional, defaults to last failed)"}
239+
"command_id": {"type": "integer", "description": "Run ID of the failed command (omit to use most recent failed command)"}
240240
}
241241
}
242242
},

0 commit comments

Comments
 (0)