Skip to main content
Glama

spec_gen

Generate module/API spec from source symbols in memory without file writes. Provide project root and file path to retrieve spec.

Instructions

Generate module/API spec from source symbols; returns in-memory spec, never writes files.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileYesSource file (relative to workspace_dir) to generate spec for
workspace_dirYesREQUIRED: project root (abs). reindex first if new.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed2 schema fields changedv0.4.5-post9
    • addedInput schema / properties / file / description
      "Source file (relative to workspace_dir) to generate spec for"
    • addedInput schema / properties / workspace_dir / description
      "REQUIRED: project root (abs). reindex first if new."
  2. First observed

TDQS

A4/5.0
Behavior3/5

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

With no annotations, the description carries the burden. It discloses a key behavior: 'never writes files', which is useful. However, it does not mention required preconditions (e.g., reindexing), permission needs, or error behavior. The in-memory return is a significant safety trait but additional behavioral context would strengthen the description.

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?

Two concise sentences, front-loaded with a clear verb, and no redundant words. Every phrase earns its place, efficiently conveying both purpose and a key behavioral guarantee.

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?

The tool is simple (2 params, no output schema), and the description covers purpose and a critical safety trait. It lacks details on return structure or prerequisites, but these are minor gaps for a spec generator with good schema coverage. Slightly more behavioral context (e.g., side-effect-free in more detail) would make it complete.

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?

Schema description coverage is 100%, so the baseline of 3 applies. The description adds minimal parameter context beyond 'from source symbols', which hints at the file's role but does not explain the parameters in depth. The schema descriptions already clarify both parameters adequately.

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 verb 'generate' is specific and the resource is clearly defined as 'module/API spec from source symbols'. It distinguishes from siblings like write_symbols (writes symbols) and read_symbol (reads symbols). The phrase 'never writes files' further clarifies its non-mutating role.

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?

The description implies a safe, read-only operation by stating 'returns in-memory spec, never writes files'. This gives clear context but does not explicitly name alternative tools or state when not to use it. It could benefit from an explicit reference to a sibling like write_symbols, but the context is strong enough.

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

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/wulun811/LiuHe'

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