Skip to main content
Glama

sample_messages

Sample newest Kafka messages from up to 20 topics to inspect field paths, value formats, schemas, and offsets, helping design search predicates and find schemas to produce against.

Instructions

Sample the newest messages of 1 to 20 topics in one call through items, and summarize value formats, field paths, key usage, the schemas values were written with, and sampled offset ranges. Use this to design a search_messages predicate, and to find the schema to produce against.

Avro, Protobuf and JSON Schema values carrying a Schema Registry id, and topics with a configured format, are decoded, so their field paths are reported like JSON. value_formats.undecodable counts values that named a schema but could not be decoded; decode_error on each message says why.

Results follow items order, each carrying index with result or error. Sampling one topic is an items array of length one. The sample describes recent data only, and keys must not be used to guess partitions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemsYesThe topics to sample, 1 to 20 of them. Sampling one topic is an array of length one. Results follow this order and a topic that cannot be sampled is reported against its own item.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
atomicYes
failedYes
appliedYes
resultsYes
succeededYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.4/5.0
Behavior5/5

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

No annotations, so the description carries full burden and does so well: it discloses decoding of Avro/Protobuf/JSON Schema values with a Schema Registry id, the meaning of value_formats.undecodable and per-message decode_error, ordered results with per-item index/error, and the caveats that the sample covers recent data only and keys must not be used to guess partitions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core verb and scope, then decode behavior and result shape. It is fairly long but nearly every sentence adds operational value (decoding rules, error fields, order semantics); a little compression is possible in the decode paragraph.

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?

An output schema exists, so return-value documentation is not required, yet the description still explains result ordering, per-item error reporting and undecodable counts. Combined with the fully covered input schema, an agent has everything needed to call it correctly.

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% and the schema already documents topic, partitions, sample_size and max_value_bytes with defaults, so the baseline is 3. The description adds the 1-to-20 bound and order-preservation semantics of items, but no extra syntax or default detail beyond the 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?

States a specific verb (sample) and resource (newest messages of 1-20 topics) plus the summarized dimensions (value formats, field paths, key usage, schemas, offset ranges). It also names the sibling it feeds into (search_messages), so an agent can distinguish it from search_messages, get_message and describe_topic without opening a schema.

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?

Explicitly tells the agent when to reach for it: 'Use this to design a search_messages predicate, and to find the schema to produce against.' Context is clear, but it gives no when-not or explicit exclusion against alternatives like get_message or search_messages for direct reads.

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