SAGE
SAGE is a token-saving AI coding agent assistant that compresses terminal output, manages command history, and provides agentic error recovery — all accessible via MCP tools.
Command Execution & History
sage_call– Run any shell command with purpose metadata (read, search, test, build, deploy, audit) for quality trackingsage_agentic_run– Run a command with automatic retry/fix/verify loop on failure (configurable autonomy: suggest, ask, or auto)sage_get_history– Retrieve recent command history, optionally filtered to failed commands onlysage_show_raw– Recover the exact original (uncompressed) output of any previous run by ID
Error Analysis & Fixing
sage_explain_error– Get an AI-friendly explanation of a command errorsage_suggest_fix– Get suggested fixes for a failed commandsage_agentic_fix– Get an auto-fix suggestion with strategy and confidence scoresage_agentic_session– Inspect the current agentic session state (failure streak, recent errors, intent chain)
File Operations (Token-Efficient)
sage_read_file– Read files with SAGE compression; supports line ranges and symbol-only outlinessage_write_file– Create or update a file, returning a compact confirmation instead of echoing full contentsage_edit_file– Perform exact string replacement with a compact change preview and automatic pre-edit snapshot for undo
Search & Navigation
sage_grep– Search files with compressed, grouped results preserving exact paths and line numberssage_glob– Find files by glob pattern (newest first, junk directories ignored, capped output)sage_tree– Get a compact, depth-limited directory overview
Agents & Workflows
sage_spawn_agent– Spawn a specialized sub-agent for a task (types: code, test, debug, security, performance)sage_run_workflow– Execute a named workflow pipeline (e.g., test, ci, deploy) or a custom workflow YAML file
All operations prioritize token efficiency by compressing output and keeping raw logs local, while an agent firewall blocks destructive commands and detects secret exposure.
SAGE - Smart Agent Guidance Engine
SAGE is a local-first command wrapper for AI coding agents. It keeps full terminal output on your machine, sends agents a clean compressed summary, and tracks proof metrics without uploading your raw logs.
Use it with Claude Code, Codex, Cursor, Windsurf, OpenCode, Cline, custom agents, CI scripts, and normal terminal workflows.
Start Here: Install SAGE, Use once sage run -- python -m pytest, Then Use Any AI Agent
Package installation is passive for package-registry safety. After installing, run sage install once to connect this machine and activate SAGE for supported local AI agents.
PyPI / pip
pip install psycgod-sage
# or
python -m pip install --upgrade psycgod-sage
sage install
sage run -- python -m pytestnpm / npx
npm install -g psycgod-sage
npx -y psycgod-sage install
npx -y psycgod-sage run -- npm testAfter install, restart any open AI-agent sessions. New sessions should read the SAGE instructions automatically and route terminal commands through SAGE.
Example prompt after restarting your AI agent:
Please help me with my general book in this folder.Natural shortcuts also work:
sage pytest
sage npm test
sage git statusThese are treated as:
sage run -- pytest
sage run -- npm test
sage run -- git statusRelated MCP server: knitbrain
What SAGE Does
Step | Result |
| Connects the machine, repairs global/project agent instructions, and verifies activation |
| Runs the command, stores raw output locally, and returns a compact useful summary |
Agent memory/hooks | Tell supported AI agents to use SAGE for noisy terminal work |
Local database | Keeps command history, compression proof, and retry context on the user's machine |
Optional cloud proof | Sends aggregate metrics only when connected proof mode is enabled |
SAGE does not auto-enable MCP. MCP is optional and manual for users who want it.
Live Proof
Latest pulled stats as of 2026-08-01:
Metric | Value |
SAGE telemetry command events | 27,892 |
Tokens processed | 799.5M |
Tokens saved | 783.7M |
Compression rate | 98.02% |
Estimated savings | $16,261.90 |
Command success rate | 88.3% |
PyPI downloads, last 7 days | 632 |
npm downloads, last 7 days | 362 |
GitHub clones, last 14 days | 574 |
Live dashboard: sage.api.marketingstudios.in/dashboard Install page: sage.api.marketingstudios.in/install

Why It Helps
AI coding agents burn context on repeated logs, failed test output, install noise, stack traces, and build spam. SAGE sits between the command and the agent.
Without SAGE | With SAGE |
Agent sees full noisy terminal output | Agent sees the useful summary |
Context disappears fast | Context lasts longer |
Repeated failures waste tokens | Errors are grouped and explained |
Raw logs may enter prompts | Raw logs stay local |
Hard to prove savings | SAGE records proof metrics |
Distribution
Channel | Package | Status |
PyPI | Canonical Python package | |
npm / npx | Node launcher for the Python core | |
MCP Registry |
| Optional/manual MCP entry |
Glama | Optional/manual hosted MCP listing |
The npm package delegates to the Python implementation so both install paths use the same local database, telemetry rules, compression, and command behavior.
Common Commands
sage install # Activate this machine and AI-agent instructions
sage doctor --activation # Verify activation
npx -y psycgod-sage doctor --activation
sage run -- <command> # Wrap any command
sage run --cwd /project -- <command> # Explicit workspace for host integrations
sage pytest # Shortcut for: sage run -- pytest
sage npm test # Shortcut for: sage run -- npm test
sage git status # Shortcut for: sage run -- git status
sage context stats # Token savings summary
sage context report # Full compression report
sage history --limit 10 # Recent command history
sage explain --failed # Explain the latest failed command
sage suggest --failed # Suggest the next fix
sage fix --apply # Try an automatic fix
sage ml setup # Optional ML V2 dependencies
sage mcp install # Optional/manual MCP config
sage dashboard start # Local dashboardPrivacy Modes
Mode | Requires login? | Sends data? | What leaves the machine? |
Local-only | No | No | Nothing |
Connected proof | Machine auth | Yes | Aggregate counters and proof metrics |
Debug telemetry | Optional | Opt-in only | Redacted diagnostic summaries |
SAGE is designed to keep prompts, source code, credentials, raw command output, and project files local unless the user deliberately enables a feature that requires sending data.
Known Limitations
Limitation | What To Do |
Already-open AI-agent sessions may not reload new instructions | Restart Claude/Codex/Cursor/Windsurf/OpenCode after |
Locked-down host apps can disable shell tools | SAGE cannot enable tools the host application has blocked |
A host starts its shell in the wrong folder | Pass |
npm/PyPI installs cannot safely auto-run activation | Run |
MCP can disconnect in some stdio agent sessions | Use normal |
Package installs are passive by design | Real activation starts with |
Demos
Flow | Preview |
PyPI install |
|
npm install |
|
| |
CLI run |
|
Links
Landing: sage.api.marketingstudios.in
Dashboard: sage.api.marketingstudios.in/dashboard
Install guide: sage.api.marketingstudios.in/install
License
MIT. See LICENSE.
Available Tools
11 toolssage_agentic_runA
Run one local command with SAGE's failure-recovery loop. Use for development commands where automatic diagnosis and retry may help, such as tests or builds. Autonomy controls behavior: suggest reports fixes only, ask requires confirmation, auto may apply safe fixes and retry. Returns command result, recovery attempts, and verification status. Do not use for destructive commands, credential entry, production deploys, or external account changes.
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | Single local command to execute with recovery enabled. | |
| autonomy | No | How autonomous: suggest (report only), ask (confirm), auto (fix automatically) | auto |
| max_retries | No | Maximum recovery attempts. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so the description carries full burden. It explains the autonomy levels (suggest, ask, auto) and what each does, and mentions the return includes command result, recovery attempts, and verification status. It does not disclose potential side effects beyond running the command, but given the nature of the tool, this is adequate.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, well-structured paragraph. It leads with the core action, then provides usage guidance, then explains autonomy, then expected output, and ends with exclusions. Every sentence adds value without redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no output schema, the description covers the return structure (result, recovery attempts, verification status). It also explains the three parameter options adequately. For a tool with three parameters and moderate complexity, this is nearly complete; a more detailed explanation of verification status could push it to 5.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with descriptions for all three parameters. The description adds value by explaining the autonomy levels in context ('suggest reports fixes only, ask requires confirmation, auto may apply safe fixes and retry') and the role of max_retries, though the schema already captures the basics. Scores above baseline 3 due to useful elaboration.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it runs one local command with SAGE's failure-recovery loop. It specifies the verb 'run', the resource 'local command', and the unique feature 'failure-recovery loop', distinguishing it from siblings like sage_agentic_fix.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly states when to use: 'development commands where automatic diagnosis and retry may help, such as tests or builds.' Also lists when not to use: 'Do not use for destructive commands, credential entry, production deploys, or external account changes.' This provides clear guidance for tool selection.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
sage_callA
Run one local shell command through SAGE with a purpose label. Use when you need command execution and want the result categorized as read, search, test, build, deploy, audit, or unknown. Returns exit_code, compact output, run_id, purpose, and agent metadata. Side effects are exactly the side effects of the command itself. Do not use for secrets, credential prompts, or deployment unless explicitly requested.
| Name | Required | Description | Default |
|---|---|---|---|
| agent | No | Name of the calling agent for multi-agent tracking | mcp |
| command | Yes | Single local shell command to execute through SAGE. | |
| purpose | No | Why this command is being run - improves ML failure prediction | unknown |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description fully addresses behavioral aspects. It clearly states: 'Side effects are exactly the side effects of the command itself,' and lists the return fields (exit_code, compact output, run_id, purpose, agent metadata). This gives the agent a complete understanding of what to expect and the risks involved.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise (about 60 words over three sentences) and front-loaded with the core action. Every sentence provides essential information: the main function, when to use it, what it returns, and safety warnings. There is no redundancy or extraneous content.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the absence of annotations and output schema, the description is remarkably complete. It covers purpose, usage guidelines, behavioral traits (side effects), return values, and security warnings. This is sufficient for an agent to correctly invoke and understand the tool's behavior without needing additional context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema covers 100% of parameters with descriptions, so the baseline is 3. The description adds minimal additional meaning beyond the schema: it mentions the purpose label and lists categories (read, search, test, etc.), which are already enumerated in the schema. The only extra is noting that purpose 'improves ML failure prediction.' Thus, the description adds limited value over the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's primary function: 'Run one local shell command through SAGE with a purpose label.' This provides a specific verb (run) and resource (local shell command), and the mention of SAGE and purpose label distinguishes it from sibling tools like sage_explain_error or sage_suggest_fix, which handle error explanation and fix suggestions rather than direct command execution.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly states when to use the tool ('Use when you need command execution and want the result categorized') and when not to use it ('Do not use for secrets, credential prompts, or deployment unless explicitly requested'). This provides clear usage boundaries and alternative considerations, aiding the agent in correct selection.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
sage_explain_errorA
Explain why a previous SAGE command failed. Use after a non-zero command exit before editing code or retrying. Input is an optional SAGE run id; when omitted, the most recent failed run is analyzed. Returns a structured object with error_type, summary, root_cause, affected_files, and suggestions. Read-only: does not run commands, edit files, or contact external services.
| Name | Required | Description | Default |
|---|---|---|---|
| command_id | No | Optional SAGE run id to analyze. Omit to analyze the most recent failed command. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description fully carries the burden of behavioral disclosure. It explicitly states 'Read-only: does not run commands, edit files, or contact external services,' which is critical for an AI agent to understand safety. It also describes the return structure and behavior when the parameter is omitted. This is comprehensive and transparent.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise with three sentences. The first sentence immediately states the purpose. Every sentence adds necessary information: purpose, usage, return structure, and behavioral constraints. No redundancy or filler.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (one optional parameter, no output schema, no nested objects), the description fully covers all needed aspects: purpose, when to use, behavior, parameter semantics, and return structure. The agent can reliably select and invoke this tool without ambiguity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The sole parameter 'command_id' is optional and has 100% schema description coverage. The description adds meaning beyond the schema: 'Omit to analyze the most recent failed command.' This clarifies the default behavior and the nature of the parameter, which is sufficient for correct invocation.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: to explain why a previous SAGE command failed. It uses a specific verb 'explain' and resource 'why a previous SAGE command failed'. This distinguishes it from siblings like sage_suggest_fix (which suggests fixes) and sage_run_workflow (which runs workflows).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides explicit usage context: 'Use after a non-zero command exit before editing code or retrying.' It also clarifies when not to use by stating it is read-only. However, it does not explicitly mention alternative tools or provide exclusion criteria beyond the read-only nature, which would strengthen the guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
sage_get_historyA
List recent local SAGE command runs. Use to find a run_id for sage_show_raw, sage_explain_error, or sage_suggest_fix. Returns compact metadata such as run_id, command summary, exit_code, duration, timestamp, and compression ratio. Read-only: reads the local SAGE database only and does not execute commands.
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Number of recent commands to retrieve (most recent first) | |
| failed_only | No | Filter to commands with non-zero exit code only |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Explicitly declares read-only behavior and that it reads a local database without executing commands, compensating for the absence of annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three concise sentences front-load the core action, purpose, and key details with no redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the simple schema and no output schema, the description fully covers the tool's purpose, return data fields, and safety profile.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema already describes both parameters (limit, failed_only) with 100% coverage; description adds no additional semantic value for parameters beyond what schema provides.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states the tool lists recent SAGE command runs and explicitly connects to sibling tools (sage_show_raw, sage_explain_error, sage_suggest_fix), distinguishing its role as a lookup tool for run IDs.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Directly advises to use this tool to find run_ids for specific sibling tools, but does not explicitly state when not to use it or what alternatives might exist.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
sage_globA
Find files by pattern, newest first, junk directories ignored, capped output. Prefer over recursive directory listings.
| Name | Required | Description | Default |
|---|---|---|---|
| root | No | Root directory | . |
| limit | No | Max files returned | |
| pattern | Yes | Pattern, e.g. **/*.py |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description covers key behaviors: ordering (newest first), ignoring junk directories, and capping output. It does not detail what junk directories are or confirm read-only nature, but the disclosed traits are valuable.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, front-loaded with the core action, no fluff. Every word serves a purpose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no output schema, the description covers the tool's purpose and key traits. The lack of output format details is a minor gap, but the context is sufficient for an agent to use it correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so baseline 3. The description does not add new parameter semantics beyond what the schema already provides (e.g., pattern format, root default).
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Find files by pattern'), includes specifics ('newest first, junk directories ignored, capped output'), and distinguishes it from sibling tools like sage_tree (recursive directory listings).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly advises to 'Prefer over recursive directory listings,' providing a clear usage context. It could be improved by also mentioning when not to use (e.g., for content search, use sage_grep), but the guidance is sufficient.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
sage_grepA
Search files with compressed, grouped results (exact paths and line numbers kept). Prefer this over rg/grep when output may be large.
| Name | Required | Description | Default |
|---|---|---|---|
| glob | No | Filename filter, e.g. *.py | |
| paths | No | Paths to search | |
| pattern | Yes | Regex pattern | |
| ignore_case | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must carry the full burden. It discloses that results are compressed and grouped with exact paths and line numbers, but omits details like follow-symlinks, error handling, or performance limits.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two brief sentences, front-loading the core purpose and a usage hint. No wasted words, earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
No output schema exists, so the description should clarify return format. It states paths and line numbers are kept but not structure (e.g., text vs JSON) or behavior for no matches, leaving gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 75% (all parameters have descriptions), so the baseline is 3. The tool description adds no additional parameter-level information beyond what is already in the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states 'Search files with compressed, grouped results' with specific output traits. Distinguishes from external tools rg/grep and implicitly from siblings by focusing on content search with grouping.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Directly advises to prefer this tool over rg/grep when output may be large, providing a clear usage context. Lacks explicit when-not-to-use or alternatives for small outputs.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
sage_read_fileA
Read a file with SAGE compression: small files exact, large files as outline + head with line references. Prefer this over cat/type/Get-Content to save context.
| Name | Required | Description | Default |
|---|---|---|---|
| raw | No | Return exact full content | |
| path | Yes | File path to read | |
| lines | No | Optional exact range START:END, e.g. 120:220 | |
| symbols | No | Return only the symbol outline | |
| max_tokens | No | Token budget for large files |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Describes compression strategy but omits details like what 'outline + head with line references' means exactly. No annotation support, so description carries full burden; lacks clarity on return format and side-effect-free read behavior.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two concise, front-loaded sentences with no redundancy. Every sentence adds value: first explains core function, second gives usage guidance.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no output schema and no annotations, description should explain return format and behavior more thoroughly. Mentions compression but lacks specifics on what 'exact' and 'outline + head' means for large files. Adequate but not comprehensive.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema covers 100% of parameters with descriptions. Description adds context on overall behavior but does not enhance meaning of individual parameters beyond schema. Baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states it reads files with SAGE compression, specifying behavior for small vs large files. Distinguishes from generic file readers like cat/type/Get-Content, implying it's the preferred tool for reading files in this context.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly advises preferring this over cat/type/Get-Content to save context, giving a clear use case. Does not explicitly exclude alternatives like sage_show_raw, but context implies it's for compression benefits.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
sage_run_workflowA
Run a named local workflow through SAGE, such as test, lint, build, or ci. Use when the project has a repeatable workflow and you want one structured result instead of several separate shell calls. The workflow must be local/project-defined. Returns success, per-step status, duration, and compact output. Side effects: runs the workflow's local commands and may change files if the workflow commands do. Do not use for deployment unless the user explicitly requested deployment.
| Name | Required | Description | Default |
|---|---|---|---|
| workflow_name | Yes | Local workflow name, for example test, lint, build, or ci. | |
| workflow_path | No | Optional path to a local workflow YAML file. Omit to use the default project workflow file. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description fully covers behavior: it returns success, per-step status, duration, compact output, and discloses side effects ('runs the workflow's local commands and may change files'). This adds significant transparency beyond what annotations would provide.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is compact (5 sentences), front-loaded with the core purpose, and every sentence adds distinct value (use case, return, side effects, exclusion). No unnecessary words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no output schema, the description adequately explains return values and side effects. It covers the two parameters well. A slight gap: no mention of error handling if workflow doesn't exist, but overall sufficient for the tool's moderate complexity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, and the description adds meaningful examples for workflow_name (test, lint, build, ci) and clarifies workflow_path usage ('Optional path... Omit to use the default'). This goes beyond the bare schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool runs a named local workflow through SAGE, listing concrete examples (test, lint, build, ci). It distinguishes this tool from siblings by focusing on structured workflow execution rather than individual shell calls.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives clear when-to-use context ('when the project has a repeatable workflow and you want one structured result instead of several separate shell calls') and a specific exclusion ('Do not use for deployment unless the user explicitly requested deployment'). It does not explicitly name alternative sibling tools but provides strong guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
sage_show_rawA
Recover the exact stored output of a previous run by ID (compression never destroys the original).
| Name | Required | Description | Default |
|---|---|---|---|
| run_id | No | Run ID (omit for latest run) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Although no annotations are provided, the description includes a behavioral guarantee ('compression never destroys the original'), adding transparency. However, it omits details like read-only nature, required permissions, or error handling when run_id is invalid.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, clear sentence with no unnecessary words. It conveys the purpose and a key behavioral trait efficiently.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has one optional parameter and no output schema. The description explains the purpose and a guarantee, but does not describe what is returned (e.g., format, size). For a retrieval tool, this is only partially complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 100% schema description coverage, the parameter is already well-documented. The description adds minimal value by repeating 'by ID', but does not provide additional context beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool recovers exact stored output of a previous run by ID, specifying the action and resource distinctly. It distinguishes from siblings like sage_get_history which likely show summaries rather than raw output.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implicitly indicates usage when you need raw output by run ID, but offers no explicit guidance on when to use this tool versus alternatives like sage_get_history or sage_explain_error. No exclusions or alternatives are mentioned.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
sage_suggest_fixA
Suggest safe next steps for a failed SAGE command. Use after sage_explain_error when you want possible fixes but do not want them executed automatically. Returns a list of fix suggestions with explanation, confidence, and candidate command when available. Read-only: it never applies patches and never runs the suggested command.
| Name | Required | Description | Default |
|---|---|---|---|
| command_id | No | Optional SAGE run id. Omit to use the most recent failed command. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden. It clearly states the tool is read-only and never applies patches or runs commands, which covers key safety behavior. However, it doesn't mention error handling or response details.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise: three sentences front-loading purpose, usage, return value, and safety. Every sentence adds value with no redundancy or unnecessary words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has one optional parameter, no output schema, and simple behavior, the description covers all essential aspects: purpose, usage context, return structure, and safety. It is complete for an AI agent to select and invoke correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, with the schema already describing the optional command_id parameter and its default behavior. The description adds no additional parameter information, so baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool suggests safe next steps for a failed SAGE command, using a specific verb and resource. It distinguishes itself from siblings like sage_explain_error and sage_run_workflow by specifying when to use it and what it does.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly advises to use after sage_explain_error when possible fixes are wanted without execution. It also clarifies that it is read-only and never applies patches, setting clear expectations and alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
sage_treeB
Compact depth-limited directory overview instead of ls -R noise.
| Name | Required | Description | Default |
|---|---|---|---|
| root | No | Root directory | . |
| depth | No | ||
| limit | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description bears full responsibility. It states 'compact depth-limited directory overview' implying read-only behavior and filtering, but lacks details on side effects, permissions, or rate limits. For a tool with no annotations, this is insufficient transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single succinct sentence of 10 words communicates the core purpose without waste. Every word earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema, the description should hint at return values or format, but it does not. The tool has three optional parameters, yet the description gives no guidance on defaults or behavior. It is too minimal to fully inform an agent's decision.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is low (33%, only root has a description). The tool description adds no parameter explanations beyond the schema, failing to compensate for the gap or clarify depth and limit semantics.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it provides a compact, depth-limited directory overview, contrasting with ls -R. However, it does not explicitly differentiate from sibling tools like sage_glob or sage_grep, missing a chance to clarify its unique role.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The phrase 'instead of ls -R noise' gives clear context on when to use—when a less verbose view is needed. But it offers no when-not-to-use or alternative sibling tools, so it stops short of a 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
5 tool updates
v2.5.8- Added
sage_call - Added
sage_explain_error - Added
sage_grep - Added
sage_suggest_fix - Removed
sage_write_file
8 tool updates
v2.5.1- Removed
sage_agentic_fix - Removed
sage_agentic_session - Removed
sage_call - Removed
sage_edit_file - Removed
sage_explain_error - Removed
sage_grep - Removed
sage_spawn_agent - Removed
sage_suggest_fix
8 tool updates
v2.4.22- Changed
sage_agentic_fix2 fields changed- changed
Input schema / properties / command_id / descriptionPrevious value: -"Specific command ID (optional, defaults to last failed)"New value: +"Optional SAGE run id of the failed command. Omit to use the most recent failed command." - added
Input schema / properties / command_id / minimumAdded value: +1
- Changed
sage_agentic_run6 fields changed- changed
Input schema / properties / command / descriptionPrevious value: -"Command to execute with agentic retry"New value: +"Single local command to execute with recovery enabled." - added
Input schema / properties / command / maxLengthAdded value: +4000 - added
Input schema / properties / command / minLengthAdded value: +1 - changed
Input schema / properties / max_retries / descriptionPrevious value: -"Max fix attempts"New value: +"Maximum recovery attempts." - added
Input schema / properties / max_retries / maximumAdded value: +5 - added
Input schema / properties / max_retries / minimumAdded value: +0
- Changed
sage_call5 fields changed- changed
Input schema / properties / agent / descriptionPrevious value: -"Calling agent name"New value: +"Name of the calling agent for multi-agent tracking" - changed
Input schema / properties / command / descriptionPrevious value: -"Command to execute"New value: +"Single local shell command to execute through SAGE." - added
Input schema / properties / command / maxLengthAdded value: +4000 - added
Input schema / properties / command / minLengthAdded value: +1 - added
Input schema / properties / purpose / descriptionAdded value: +"Why this command is being run - improves ML failure prediction"
- Changed
sage_explain_error2 fields changed- changed
Input schema / properties / command_id / descriptionPrevious value: -"Specific command ID (optional, defaults to last failed)"New value: +"Optional SAGE run id to analyze. Omit to analyze the most recent failed command." - added
Input schema / properties / command_id / minimumAdded value: +1
- Changed
sage_get_history4 fields changed- changed
Input schema / properties / failed_only / descriptionPrevious value: -"Only show failed commands"New value: +"Filter to commands with non-zero exit code only" - changed
Input schema / properties / limit / descriptionPrevious value: -"Number of commands to retrieve"New value: +"Number of recent commands to retrieve (most recent first)" - added
Input schema / properties / limit / maximumAdded value: +100 - added
Input schema / properties / limit / minimumAdded value: +1
- Changed
sage_run_workflow5 fields changed- changed
Input schema / properties / workflow_name / descriptionPrevious value: -"Name of workflow to run (e.g., 'test', 'ci', 'deploy')"New value: +"Local workflow name, for example test, lint, build, or ci." - added
Input schema / properties / workflow_name / maxLengthAdded value: +80 - added
Input schema / properties / workflow_name / minLengthAdded value: +1 - changed
Input schema / properties / workflow_path / descriptionPrevious value: -"Path to workflow YAML file (optional)"New value: +"Optional path to a local workflow YAML file. Omit to use the default project workflow file." - added
Input schema / requiredAdded value: +[ + "workflow_name" +]
- Changed
sage_spawn_agent4 fields changed- changed
Input schema / properties / agent_type / descriptionPrevious value: -"Type of agent to spawn"New value: +"Specialization: code (implement), test (verify), debug (investigate), security (scan), performance (optimize)" - changed
Input schema / properties / task / descriptionPrevious value: -"Task description for the agent"New value: +"Concrete bounded task for the specialist, including target files or command context when known." - added
Input schema / properties / task / maxLengthAdded value: +1000 - added
Input schema / properties / task / minLengthAdded value: +8
- Changed
sage_suggest_fix2 fields changed- changed
Input schema / properties / command_id / descriptionPrevious value: -"Specific command ID (optional, defaults to last failed)"New value: +"Optional SAGE run id. Omit to use the most recent failed command." - added
Input schema / properties / command_id / minimumAdded value: +1
16 tool updates
v0.1.0- First observed
sage_agentic_fix - First observed
sage_agentic_run - First observed
sage_agentic_session - First observed
sage_call - First observed
sage_edit_file - First observed
sage_explain_error - First observed
sage_get_history - First observed
sage_glob - First observed
sage_grep - First observed
sage_read_file - First observed
sage_run_workflow - First observed
sage_show_raw - First observed
sage_spawn_agent - First observed
sage_suggest_fix - First observed
sage_tree - First observed
sage_write_file
TDQS
All tools have clearly distinct purposes: file reading, searching, command execution, error analysis, etc. The related pair of explain_error and suggest_fix are differentiated by action (explain vs suggest). No overlap or ambiguity.
Every tool follows the sage_verb_noun convention consistently, using snake_case throughout. Examples: sage_explain_error, sage_run_workflow, sage_get_history. The pattern is predictable and clear.
11 tools is a well-scoped set for the server's purpose of SAGE-assisted development. It covers file operations, searching, command execution, workflow running, error diagnosis, and history without being excessive or minimal.
The tool set covers the full lifecycle of working with a SAGE command: reading files, searching, executing commands (with and without auto-recovery), running workflows, analyzing errors, and retrieving history. No obvious gaps for its stated domain.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Real-time chat hub for AI agents — Claude Code, Cursor, Cline, Codex over MCP or REST.
Real-time chat for AI agents. Claude Code, Cursor, Cline and Codex join channels over MCP.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Related MCP Servers
- FlicenseNot gradedqualityNot gradedmaintenanceA secure and pluggable MCP server to run terminal commands on your local machine or cloud server — remotely, safely, and with LLMs or agentic clients.-
- AlicenseAqualityAmaintenanceLocal-first MCP server that gives any AI coding agent per-project memory, workflow intelligence, and always-on, lossless token & context optimization.37183MIT
- AlicenseAqualityAmaintenanceAn agent-native shell as an MCP server, designed for LLM agents (like Claude Code) to execute commands with structured output, lazy detail retrieval, and effect tracking, minimizing token usage.914MIT
- FlicenseNot gradedqualityAmaintenanceLocal MCP server that lets your AI coding agent query its own cross-tool project history - file/command freshness, past test failures, cost & token spend, cache status, and session handoff - over stdio, 100% local, no telemetry.42-
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/PsYcGoD/sage'
If you have feedback or need assistance with the MCP directory API, please join our Discord server


