Skip to main content
Glama

agent_functions_get_code

Read-onlyIdempotent

Read one Code function's full editable definition by its ID from agent_functions_list: name, description, instruction, active state, language, source, input schema and saved tests. Call it before agent_functions_update_code, which needs the complete definition back; to only check the tests use agent_functions_run_tests. HTTP functions have no code to read.

Input Schema

NameRequiredDescriptionDefault
functionIdYesAgent Function ID from agent_functions_list.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint and destructiveHint=false, so the safety profile is covered. The description adds real context beyond that: the definition is the 'full editable' one, it is a prerequisite for the update flow, and HTTP functions return no code. It does not discuss error behavior for an invalid ID, which keeps it from a 5.

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 tight sentences, front-loaded with the core action and return contents, followed by the sequencing rule and the edge case. No redundant restatement of the name or title.

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?

There is no output schema, but the description compensates by enumerating the returned fields, and it covers the prerequisite relationship and the HTTP-function edge case. For a single-parameter read tool, nothing an agent needs to call it correctly is missing.

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% and the single parameter is already documented, so the baseline is 3. The description adds provenance by pointing to agent_functions_list as the source of the ID, which helps the agent obtain a valid value.

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 ('Read one Code function's full editable definition by its ID') and enumerates exactly what is returned: name, description, instruction, active state, language, source, input schema and saved tests. It is clearly distinguishable from agent_functions_list, agent_functions_update_code and agent_functions_run_tests.

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?

Gives explicit sequencing guidance ('Call it before agent_functions_update_code, which needs the complete definition back'), names the alternative for a narrower need ('to only check the tests use agent_functions_run_tests'), and states an exclusion ('HTTP functions have no code to read').

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