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
| Name | Required | Description | Default |
|---|---|---|---|
| files | Yes | ||
| context | No | ||
| message | Yes | ||
| scan_all | No | ||
| repo_path | No | ||
| project_name | No | ||
| workflow_uuid | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |