Skip to main content
Glama

mort_emit_c

Generate and inspect the C code Mort emits for a program, including bare-metal freestanding output without libc or main, to verify constructs or debug code generation.

Instructions

Show the C that Mort generates for a program (useful to see what a construct compiles to, or to debug codegen). freestanding=True emits bare-metal C (no libc, no main) as used for the MORT OS kernel.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "mort_emit_c"
  }
}

Input Schema

NameRequiredDescriptionDefault
filesNo
sourceNo
freestandingNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description must carry the full behavioral burden. It discloses an important mode distinction for freestanding=True: bare-metal C with no libc and no main, used for the MORT OS kernel. However, it does not explicitly state overall safety or side-effect profile, such as whether the tool only emits text or performs any writes.

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?

The description is two compact sentences with no wasted wording. The core purpose is front-loaded, and the parameter-specific detail follows naturally.

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?

The output schema covers return values, and the description adequately explains the main purpose and freestanding mode. It is still incomplete for a tool with three optional, undocumented parameters because it leaves the files/source invocation model unexplained.

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

Parameters2/5

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

Schema description coverage is 0% with three parameters, so the description needs to compensate. It explains freestanding=True meaningfully, but files and source are never described; it does not say how they are used, whether one takes precedence, or whether either is required.

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 description states a specific verb and resource: 'Show the C that Mort generates for a program.' It also gives concrete use cases (see what a construct compiles to, debug codegen). It does not explicitly distinguish itself from nearby tools like mort_run or mort_check, so it stops short of a 5.

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 gives clear usage context: useful for seeing what a construct compiles to and for debugging codegen. It does not state when not to use it or name alternative tools, so it lacks the explicit exclusion/alternative guidance needed for a 5.

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