Skip to main content
Glama
jansc4
by jansc4

Build prompts from template

llm_build_prompts
Read-onlyIdempotent

Generate complete prompts in bulk by filling a template with each list item, using positional or named placeholders for structured data.

Instructions

Fills a template (Python str.format) with each item in a list. A step between a producer and ask_llm in for_each — builds N full prompts without the agent having to type them out by hand. Plain items (strings, numbers) fill a positional '{}' placeholder; dict items (e.g. read_file's {"path":..., "content":...}) fill named placeholders like '{content}' or '{path}' instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemsYes
templateYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and idempotentHint=true, so the safety profile is covered. The description adds useful behavioral detail: it uses Python str.format semantics, handles plain vs dict items differently, and produces multiple prompts from one template. This goes beyond the annotations without contradicting them.

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?

Three sentences, each earning its place: mechanism, pipeline context/benefit, and placeholder rules. The most important information is front-loaded, and there is no redundant restating of the title or schema.

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?

For a two-parameter tool with an output schema, the description is sufficiently complete. It specifies inputs, placeholder behavior, and where the tool fits in a larger flow. Remaining details like exact output format are covered by the output schema, so nothing essential is missing.

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

Parameters4/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. It explains both parameters: 'template' is the Python format string, and 'items' is a list that can contain plain values for positional placeholders or dicts for named placeholders. The example with read_file dict items adds real semantic value 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 states a specific verb and resource: it 'fills a template (Python str.format) with each item in a list.' It also differentiates from sibling llm_ask_llm by positioning itself as a step between a producer and ask_llm in a for_each flow. This makes the tool's role unambiguous.

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 context: use it in a for_each pipeline to build N prompts without hand-typing them, before calling ask_llm. It does not explicitly list when-not-to-use cases or name an alternative tool, but the intended usage is clear enough for an agent to decide when it applies.

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