Skip to main content
Glama

compile_prompt

Takes a JSON list of prompt blocks and compiles them into a structured XML prompt ready for Claude, including a token estimate.

Instructions

Compile a list of blocks into a Claude-optimized structured XML prompt.

Takes the JSON returned by decompose_prompt (or manually crafted blocks)
and produces a ready-to-use XML prompt with a token estimate.

Args:
    blocks_json: JSON-stringified list of blocks.
                 Each block: {"type": "role|objective|...", "content": "...",
                              "label": "...", "description": "...", "summary": ""}

Returns:
    The compiled XML prompt with token estimate.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
blocks_jsonYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

With no annotations, the description should disclose behavioral traits; it mentions the output (XML prompt with token estimate) but does not cover side effects, permissions, or error behavior, leaving some gaps.

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 concise (5 sentences plus structured Args/Returns), with the core purpose in the first sentence, and no unnecessary information.

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?

Given the tool's simplicity (1 parameter, no enums) and presence of an output schema, the description covers the input format and output summary adequately, though 'Claude-optimized' could be elaborated.

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

Parameters5/5

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

The input schema only provides a title and type, but the description thoroughly explains the parameter's format (JSON-stringified list of blocks) with field details, fully compensating for the 0% schema coverage.

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 explicitly states it compiles blocks into a Claude-optimized XML prompt, and references decompose_prompt to differentiate from siblings like list_block_types.

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?

It indicates the tool is used after decompose_prompt or with manually crafted blocks, providing clear context for when to invoke it, but does not explicitly exclude other scenarios.

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/Nyrok/flompt'

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