Skip to main content
Glama

Codebase Insights

synapse_codebase_insights

Inspect codebase structure, API boundaries, dependencies, and deletion safety. Detect languages, dead code, contracts, and refactoring opportunities to make informed code changes.

Instructions

Analyses codebase structures, API boundaries, contracts, dependencies, and deletion safety. High-level actions include:

  • 'detect': returns percentage language and framework breakdown, file count, and recommended linter audits.

  • 'public_api': lists public modules and functions, helper heuristics, and external callers count.

  • 'dead_code': performs a read-only function-level deletion-safety check for one exact symbol or chunk_id. Prefer chunk_id from a previous Synapse result; otherwise pass repo_id plus an arity-qualified symbol such as Parser.parse/2. It reports whether the symbol appears dead, splits production and test callers, explains confidence and deletion risk, marks clause-level analysis as unsupported, and tells the agent what to do next without deleting source.

  • 'contracts': scans interface boundaries (JSON/HTTP/CLI) and outward-facing schemas.

  • 'dependencies': builds an inter-module dependency graph.

  • 'overview': returns a consolidated repository overview.

  • 'refactor_opportunities': surfaces code quality improvement candidates.

REPLACES: grep_search for API surface discovery, wc for codebase sizing, manual language detection, find for framework detection. Use this tool instead of these alternatives for better results with 30-60% fewer tokens via automatic compression.

Usage (short): Detect languages, identify public APIs, check deletion safety, build dependency graphs, and surface refactoring opportunities.

Usage (long): Analyze language mix, list public API surfaces, run function-level deletion-safety checks by chunk_id or repo_id + symbol, scan interface boundaries (JSON/HTTP/CLI), build dependency graphs, surface refactoring opportunities, or retrieve a consolidated repository overview. Use 'dead_code' as the backend for ask_synapse questions like 'can I delete X?', 'is X still used?', or 'should I keep X?'. Provide chunk_id, or repo_id plus one exact symbol; bare function names are resolved only when one arity variant is indexed. If the user only gives descriptive prose, ask for the concrete symbol rather than guessing. Read scope, clause_level_analysis, safe_to_delete, deletion_risk, confidence, caveats, and supporting_evidence.production_callers/test_callers before advising. Use 'detect' to understand the language mix before choosing search modes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesThe action to perform.
max_tokensNoApproximate final response budget in tokens (500-32000, default 4000).
compress_payloadNoSet false to disable lossless response-key compression.
Behavior4/5

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

With no annotations, the description carries the full behavioral burden and responds well for 'dead_code': it labels the check read-only, highlights that no source is deleted, lists confidence/risk/caveats, and disposes of unsupported clause-level analysis. Other actions get lighter treatment and no return-shape details, so the transparency is good but not complete.

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

Conciseness4/5

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

The description is organized as a summary, per-action bullets, then a short usage block; it is front-loaded and uses lists well for a multi-action tool. The 'Usage' wording does partially repeat the action list, but the repetition is moderate for the complexity being described.

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

Completeness3/5

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

For a no-output-schema tool with seven action modes, the dead_code sub-case is very complete. Other actions are described enough to be understood but 'refactor_opportunities' remains under-specified, and the schema does not actually expose the personnel IDs/symbols/chunk identifiers the description asks for, leaving an invocation gap.

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

Parameters3/5

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

All three actual parameters already have schema descriptions, so the description is not required to carry the parameter documentation burden. It does add meaning by explaining what each action enum value accomplishes. However, the dead_code instructions tell the agent to pass repo_id/symbol/chunk_id arguments that are absent from the provided input-schema, which is misleading for actual call construction.

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?

The opening sentence names concrete resources — codebase structures, API boundaries, contracts, dependencies, and deletion safety — and the action bullets map directly to the schema enum, so the tool's purpose is clear and distinguishable from search/modify siblings. It loses a point because 'refactor_opportunities' is part of the enum but only mentioned in passing rather than given an explicit action bullet.

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

Usage Guidelines4/5

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

It gives explicit guidance for the most complex case: use 'dead_code' as the backend for ask_synapse questions like 'can I delete X?', and prefers the chunk_id over a raw symbol. It also tells the agent to ask for the concrete symbol instead of guessing and to use 'detect' before choosing search modes. It stops short of naming when-not scenarios or explicit sibling exclusions.

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

Install Server

Other Tools

Latest Blog Posts

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/myelixlabs/synapse-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server