Skip to main content
Glama

terse_parse

Parse Terse source and return its AST as JSON. Expands session aliases first and converts tuples to lists.

Instructions

Parse Terse source and return the AST as JSON (tuples become lists). Session $aliases are expanded first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourceYesTerse source code to parse.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It usefully discloses two non-obvious behaviors: JSON conversion turns tuples into lists, and session $aliases are expanded before parsing (a dependency on session state set by terse_alias_define). It says nothing about failure behavior on invalid source or whether parsing mutates session state.

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?

A single sentence with the primary action front-loaded, followed by the two caveats that actually change agent expectations (tuple-to-list, alias expansion). No filler.

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?

There is no output schema, so the description correctly characterizes the return value as an AST in JSON and flags the tuple/list representation quirk. The alias-expansion note covers the session-state interaction, leaving only error/edge-case behavior undocumented for a single-parameter tool.

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?

Only one parameter and schema description coverage is 100%, so the schema already fully documents 'source'. The description adds no syntax, format, or encoding detail beyond what the schema provides, making the baseline 3 appropriate.

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?

States a specific verb (parse) and resource (Terse source) plus the exact output form (AST as JSON), which cleanly separates it from terse_tokens (lexing), terse_transpile (compilation) and terse_eval (execution) without naming them. An agent can pick this tool from the sibling list on purpose alone.

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?

Usage is implied by the output ('return the AST'), so an agent can infer this is the tool for structural inspection rather than evaluation or transpilation. However, there is no explicit when-to-use, when-not-to-use, or named alternative, and no note about whether parsing is side-effect free.

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