Skip to main content
Glama

compile_prompt

Transforms structured JSON blocks into Claude-optimized XML prompts with token estimates for AI interactions.

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
Behavior4/5

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

With no annotations, the description carries full burden and does well: it discloses the tool's behavior (transforms JSON blocks into XML, adds token estimation) and output format. It could improve by mentioning error handling or performance traits, but covers core operations adequately.

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?

Front-loaded with the core purpose, followed by parameter and return details in a structured format. Every sentence adds value: the first defines the tool, the second explains the parameter, the third describes returns. No wasted words, efficiently organized.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (1 parameter, no annotations, but with output schema), the description is complete: it explains purpose, usage, parameter details, and return values. The output schema existence means return format needn't be detailed, but the description still adds helpful context like token estimation.

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?

Schema description coverage is 0%, so the description must compensate fully. It does: it explains the parameter 'blocks_json' as a JSON-stringified list, details the block structure with keys like 'type' and 'content', and clarifies its source or manual creation, adding significant meaning beyond the bare schema.

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 clearly states the specific action ('compile'), the resource ('list of blocks'), and the output ('Claude-optimized structured XML prompt with token estimate'). It distinguishes from sibling tools by mentioning decompose_prompt as a source and contrasting with list_block_types, which doesn't produce prompts.

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

Usage Guidelines5/5

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

Explicitly states when to use: 'Takes the JSON returned by decompose_prompt (or manually crafted blocks)', providing a direct alternative (manual crafting) and referencing a sibling tool as a common source. This gives clear context for application versus other prompt-related tools.

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