Skip to main content
Glama

suggest_code

Analyze source code files and get AI-powered improvement recommendations.

This tool returns code recommendations with 'before' and 'after' code blocks. IMPORTANT: Always display the 'before' and 'after' code blocks exactly as provided in the tool output without any modification, summarization, or omission. Show every recommendation returned by this tool.

Sends files to the Tomosu suggest API (v3) which evaluates code quality across categories like security, performance, maintainability, etc.

Args: files: List of file objects, each with 'filepath' and 'filecontent' keys. Example: [{"filepath": "src/app.py", "filecontent": "def hello(): ..."}] message: What to analyze or focus on (e.g., "Review for security issues"). project_name: Name of the project or repository (e.g., folder name or GitHub repo name). Used for tracking and dashboard display. repo_path: GitHub URL of the repository (e.g. "https://github.com/owner/repo"). IMPORTANT: Before calling this tool, run git remote get-url origin in the project directory to get the remote URL. Normalize SSH URLs (git@github.com:owner/repo.git) to HTTPS form (https://github.com/owner/repo). Strip trailing ".git". Pass the result here. If git remote is unavailable, pass the local directory path instead. repo_description: Short description of the repository / service purpose. Leave empty — the backend derives this automatically. context: Optional list of analysis categories to focus on. Available: performance, security, maintainability, logs, error, compliance, testing, api_observability, service_resilience, data_integrity, observability, reliability, drift_resistance, state_volatility, architectural_governance, support_agent_readiness, etc. If omitted, all categories are analyzed. scan_all: If True, backend skips the file quality-score pre-filter and scans every file passed. Use from claude-workflow to ensure all reliability-impacted files are scanned regardless of quality rating. workflow_uuid: If provided, all batch calls for this workflow scan share this UUID so the final report aggregates all batches. Generate once with str(uuid.uuid4()) before the first batch call and pass the same value to every subsequent batch. Also pass it as scan_uuid to save_recommendation and get_scan_report.

Returns: Structured code recommendations with before/after code blocks, severity, line numbers, and scores. ALL code blocks must be shown to the user.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filesYes
contextNo
messageYes
scan_allNo
repo_pathNo
project_nameNo
workflow_uuidNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full behavioral burden. It usefully discloses that files are sent to an external API (Tomosu suggest API v3) and that recommendations include severity, line numbers and scores. It omits auth requirements, rate limits, whether the payload is persisted server-side, and any cost implications — meaningful gaps for a tool that transmits source code off-machine.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose and the before/after display mandate are front-loaded, which is good. But the display instruction is stated twice (in the opening block and again under Returns), and the long Args prose could be tightened; the response is functional but not economical.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return-value structure needn't be re-explained, yet the description usefully adds the non-negotiable display contract and cross-tool UUID threading with save_recommendation/get_scan_report. One inconsistency: repo_description is documented in Args but does not appear in the input schema, which could confuse an agent assembling the payload.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate — and it does, documenting all seven parameters with examples, SSH-to-HTTPS normalization rules for repo_path, the full category list for context, and the batch-aggregation semantics of workflow_uuid. This is exactly the kind of parameter explanation that lifts a 0%-coverage schema to usable.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource — 'Analyze source code files and get AI-powered improvement recommendations' — and names the backend (Tomosu suggest API v3) and the categories it evaluates. It is clearly distinguishable from read-only siblings like get_scan_report or get_dashboard_analytics, though it never explicitly contrasts itself with score_pull_request, the closest sibling.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides strong operational guidance embedded in the parameter docs (run `git remote get-url origin` before calling, generate one workflow_uuid per batch and reuse it, use scan_all from claude-workflow), which routes multi-call usage effectively. However, it gives no explicit when-to-use guidance relative to siblings such as score_pull_request or save_recommendation; the reader must infer the workflow from scattered parameter notes.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources