Skip to main content
Glama

topos_evaluate_code

Read-onlyIdempotent

Score a code snippet for SIMPLE and SECURE quality dimensions via static CFG/CPG analysis. Returns a lattice verdict from SLOP to IDEAL with generator scores.

Instructions

Score a raw code string on the SIMPLE / COMPOSABLE / SECURE quality lattice (read-only; never writes or runs the code). Use for a snippet not yet on disk. Only SIMPLE and SECURE are reachable here (scored from the source's CFG/CPG); COMPOSABLE needs a module dependency graph, so for it use topos_evaluate_file with gitnexus_dir, or topos_evaluate_project for a whole tree. Returns an EvaluationResult: the lattice verdict (SLOP…IDEAL), per-generator scores, and a next-step agent contract.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesSource code to evaluate.
allowNoOne-off acknowledged dangerous-call patterns.
verboseNoInclude raw metrics.
languageNoLanguage: python, rust, javascript, typescript, cpp, or go.python
preferencesNoOptional generator ranking.
Behavior5/5

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

Description reinforces annotations (read-only, never writes/runs) and adds detail about only reaching SIMPLE and SECURE, plus return value description. No contradictions.

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

Conciseness5/5

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

Description is a single, focused paragraph with front-loaded purpose. Every sentence adds value with no redundancy.

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

Completeness5/5

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

Despite no output schema, the description enumerates return fields. All parameters are covered, and sibling differentiation is clear. The tool's scope and limitations are fully communicated.

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

Parameters4/5

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

Schema coverage is 100% with descriptions for all parameters. The description adds context about generator availability (only SIMPLE and SECURE reachable), which aids understanding of preferences parameter.

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

Purpose5/5

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

The description clearly states the tool scores raw code on a quality lattice, specifies it is read-only, and distinguishes from siblings by noting that COMPOSABLE requires other tools.

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

Usage Guidelines5/5

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

Explicitly states when to use ('for a snippet not yet on disk') and when not to use, with named alternatives (topos_evaluate_file, topos_evaluate_project).

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/Krv-Labs/topos'

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