Skip to main content
Glama

kb_define_function

Defines a function at a given address and stores its name, parameters, description, return info, and optional end address in the persistent knowledge base, upserting by address and bank.

Instructions

Define a function at the given address.

Stores the function's name, parameter list (JSON), description, and return info. UPSERT on address+bank.

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": {
      "address": "<address>",
      "name": "<name>"
    },
    "name": "kb_define_function"
  }
}

Input Schema

NameRequiredDescriptionDefault
bankNo
nameYes
paramsNo
addressYes
returnsNo
descriptionNo
end_addressNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the entire behavioral burden. It does disclose the key mutation semantic ("UPSERT on address+bank"), which tells the agent an existing definition will be overwritten rather than erroring — genuinely useful. Beyond that it says nothing about what happens to fields omitted (all five optional params are nullable), whether params replaces or merges with existing entries, or what is returned on success/failure.

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?

Three short clauses with the operation and its persistence semantics front-loaded; nothing is padded. The multi-line formatting of the original is slightly awkward but does not harm comprehension.

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

Completeness2/5

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

For a 7-parameter mutation tool with no annotations and no output schema, the description covers the primary payload fields but leaves end_address undefined and does not address null/omitted-parameter behavior or the upsert's effect on existing data. An agent could call it, but would be guessing on roughly a third of its inputs.

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

Parameters2/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 maps most fields loosely (name, parameter list as JSON, description, return info, address, bank), but adds no format detail beyond calling params "JSON", and the seventh parameter, end_address, is never mentioned at all. Defaults (bank=null, params=null) and their meaning are left unexplained.

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?

The description gives a specific verb+resource ("Define a function at the given address") and enumerates what gets persisted (name, params, description, returns). It is clearly distinguishable from the read-only sibling kb_get_function_info, though it does not name it explicitly.

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

Usage Guidelines3/5

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

Usage is only implied: an agent can infer this is the write/create counterpart to kb_get_function_info and the function-side analogue of kb_define_enum/kb_define_struct. There is no explicit statement of when to prefer this over those siblings, nor any stated prerequisites such as the address needing to be valid or bank defaulting.

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