Skip to main content
Glama

agent_functions_update_code

DestructiveIdempotent

Replace one Code function (functionId from agent_functions_list) with a complete new definition: every field is required, so start from agent_functions_get_code and change only what the user asked. The proposed tests run first; a failing edit never replaces the current function. Show the exact function name, receptionist, behaviour, active state, language and a summary of the code and tests, then get explicit confirmation before calling.

Input Schema

NameRequiredDescriptionDefault
nameYesFunction name the receptionist sees as a tool, e.g. "check_order_status".
isActiveYesWhether receptionists may call it after the edit.
codeSourceYesComplete source defining main(input, context) that returns the result; see agent_functions_get_guide for the contract and sandbox limits.
functionIdYesAgent Function ID from agent_functions_list.
descriptionYesWhat the function does, in one or two plain sentences.
inputSchemaYesRoot input definition: a field of type "object" whose children are the arguments the receptionist passes (name, type, description, validations), e.g. {"name":"input","type":"object","children":[{"name":"orderNumber","type":"string","description":"Order number the caller gives"}]}.
instructionYesWhen and how the receptionist should call it on a live call, e.g. "Call when a caller asks where their order is; ask for the order number first."
codeLanguageYesLanguage of codeSource: PYTHON, JAVASCRIPT or TYPESCRIPT.
codeTestCasesYesThe complete new test list (1-25), replacing the saved tests; all must pass or nothing changes.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and idempotentHint=true, but the description adds substantive behavior: all fields are required so it is a full overwrite, and proposed tests run first so a failing edit never replaces the current function. This test-gated atomicity is exactly the kind of context the agent cannot infer from the hint flags.

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, front-loaded with the replacement semantics, then the source-of-truth step, then the safety/confirmation gate. No restatement of the title or filler wording.

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 9-parameter, fully-required tool with deeply nested schema and no output schema, the description covers the replacement model, the test gate and the confirmation requirement, which is sufficient to call it safely. It does not say what a successful response looks like, but with no output schema that is a minor gap given the strength of the rest.

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 100%, so the baseline is 3; the description still adds workflow-level meaning by stating every field is required and that the values should be seeded from agent_functions_get_code rather than authored from scratch. It also enumerates the fields to surface for confirmation (function name, receptionist, behaviour, active state, language, code and tests), which helps the agent fill the schema correctly.

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 and resource: "Replace one Code function (functionId from agent_functions_list) with a complete new definition." It names the exact identifier source and distinguishes itself from create_code and get_code by framing the operation as wholesale replacement of an existing function.

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

Usage Guidelines5/5

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

Explicit workflow guidance: start from agent_functions_get_code and change only what the user asked, plus an explicit gate — get confirmation before calling. It also names the sibling to read first, so the agent has both a when-to-use path and a prerequisite.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources