Skip to main content
Glama

compile

Read-only

Compile source code and return assembly output, stdout, and stderr

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "source": "<source>",
      "language": "<language>"
    },
    "name": "compile"
  }
}

Input Schema

NameRequiredDescriptionDefault
stdinNoStandard input for execution (requires execute=true)
sourceYesSource code to compile
executeNoRun the program instead of returning assembly. `asm` becomes empty; runtime output goes to top-level `stdout`/`stderr`; compile diagnostics move to `buildResult.stdout`/`stderr`.
filtersNoOutput filters
optionsNoCompiler flags (e.g. "-O2 -std=c++20 -Wall")
compilerNoCompiler ID from list_compilers (e.g. "g161"). If omitted, uses the language's `defaultCompiler` from list_languages.
languageYesLanguage ID (e.g. "c++", "c", "rust", "python")
librariesNoLibraries to link.
maxAsmLinesNoCap asm output (default 500 lines).
maxStderrLinesNoCap each stderr stream — compile and execute separately (default 100).
maxStdoutLinesNoCap each stdout stream — compile and execute separately (default 100).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / libraries / items / properties / buildType
      Added value: +{
      +  "description": "Prebuilt package to link (default Debug). Release is optimised, keeps -g, and falls back to Debug if not built.",
      +  "enum": [
      +    "Debug",
      +    "Release"
      +  ],
      +  "type": "string"
      +}
  2. First observed

TDQS

B3.3/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, and openWorldHint=false, so the safety profile is supplied. The description adds that assembly, stdout, and stderr are returned, but it does not cover execute-mode behavior, resource caps, or error handling.

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 front-loaded sentence with no wasted wording. It states the action and return streams immediately.

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 schema is rich and annotations cover safety, but for an 11-parameter compile/execute tool with no output schema, the one-line description is thin on mode switching and return structure. It names the key outputs but leaves most operational detail to the schema.

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 all 11 parameters, including nested filters and libraries, are documented in the schema. The description adds no parameter-specific syntax, defaults, or relationships beyond that.

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 names a specific verb (compile) and resource (source code) and states the main return streams. It is clearly distinct from the list_* and lookup_* siblings, though it omits the optional execution mode and any explicit sibling routing.

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

Usage Guidelines2/5

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

No when-to-use or when-not-to-use guidance is provided, and it does not point agents to list_compilers, list_languages, or list_libraries for required IDs. Usage is only inferable from the name and required source/language fields.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.