Skip to main content
Glama

kb_define_struct

Defines a named, unique data structure with typed fields, offsets, and sizes for documenting Game Boy ROM memory layouts in the knowledge base.

Instructions

Define a data structure with typed fields.

    Each field dict must have: name, offset, type, size.
    Optional: comment. Valid types: u8, u16, s8, s16, bool, bytes.
    Struct names must be unique — duplicates are rejected.
    

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "name": "<name>",
      "fields": "<fields>"
    },
    "name": "kb_define_struct"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYes
fieldsYes
commentNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.3/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It does add real behavioral detail: required field keys (name, offset, type, size), the closed type vocabulary, and that duplicate struct names are rejected. It omits whether the definition is persisted, what happens on a rejected definition (error vs. overwrite), and whether it mutates existing state.

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 purpose, then bulleted constraints in short lines with no filler. The one weak spot is the dangling "Optional: comment" line, whose scope (field-level vs. struct-level) is unclear in an otherwise precise listing.

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

Completeness3/5

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

For a 3-parameter tool with no annotations and no output schema, the description covers input structure and validation but says nothing about what is returned on success or failure, nor how the definition relates to kb_apply_struct. That is enough to call it correctly but not enough to use it confidently in a workflow.

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 coverage is 0%, so the description must compensate, and it largely does: it specifies the four required keys and optional comment for each element of the `fields` array, plus the allowed values for `type`. It does not clarify whether "Optional: comment" also applies to the top-level `comment` parameter, leaving one of three parameters ambiguous.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: "Define a data structure with typed fields." This clearly distinguishes it from siblings like kb_define_enum or kb_define_function by naming the artifact being created. It stops short of explicitly contrasting with kb_apply_struct, which presumably consumes what this tool defines.

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

Usage Guidelines2/5

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

There is no statement of when to use this versus kb_apply_struct or the other kb_define_* tools, and no prerequisites are given. The validation rules (unique names, allowed types) are constraints on invocation, not usage guidance.

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