Skip to main content
Glama

get_message

Read up to 20 Kafka messages by exact topic, partition, and offset, with optional surrounding context and Schema Registry decoding to JSON. Returns key, value, headers, timestamp, and per-item errors.

Instructions

Read 1 to 20 Kafka messages at exact addresses in one call through items, and optionally nearby messages for context. Returns key, value, headers, timestamp and original value size.

Values carrying a Schema Registry id (Avro, Protobuf, JSON Schema) and topics with a configured format are decoded to JSON; format, schema_id and message_type say what the bytes were. Anything else is returned as text, or base64 when it is binary, and decode_error explains a value that named a schema but could not be decoded.

Results follow items order, each carrying index with result or error, so an invalid partition or an offset beyond the partition end is reported against its own item rather than failing the call. Reading one message is an items array of length one.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemsYesThe message addresses to read, 1 to 20 of them. Reading one message is an array of length one. Results follow this order and an address that cannot be read 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.3/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does substantial work: it discloses result ordering, per-item error isolation ('an invalid partition or an offset beyond the partition end is reported against its own item rather than failing the call'), decoding rules, base64 fallback for binary, and decode_error semantics. It omits two relevant traits — that reading does not commit offsets (important given the commit_offset and consumer_lag siblings) and any auth/permission requirements.

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 and tightly written: the purpose sentence comes first, then behavior, then error semantics. The decoding paragraph is dense but the sentences each carry a distinct fact; the only mild waste is restating return fields (key, value, headers, timestamp) when an output schema already exists.

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?

For a single-parameter, nested-array read tool with an output schema, the description covers what to build, how results map back to requests, and how failures surface — enough to call it correctly. Its remaining gap is the absence of any statement about read-only/non-mutating behavior and permissions, which matters because siblings like commit_offset and delete_records mutate the same cluster.

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 100%, so the baseline is 3 and the schema already documents topic, partition, offset, context and max_value_bytes. The description adds real meaning beyond that: the items-level semantic that all addresses share one call, the 1-20 cardinality, and that 'reading one message is an items array of length one', which is exactly the construct an agent must build.

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 opening sentence states a precise verb and resource with scope: 'Read 1 to 20 Kafka messages at exact addresses in one call through items'. The 'exact addresses' framing plus the 1-20 bound functionally separates it from the sampling and searching siblings (sample_messages, search_messages) without either schema being opened.

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 clearly conveys the situation this tool serves — reading known offsets, optionally with nearby context via 'context' — and explains the single-message case explicitly. It never names an alternative (search_messages, sample_messages) or states when not to use it, so routing between siblings is left to inference.

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