Skip to main content
Glama

get_code

Read-only

Retrieve the exact Python script behind a forecasting plan, cross-validation strategy, backtest, forecast, or comparison—either the code that ran or the code that would run.

Instructions

Return the Python script of an object: the one that ran, or that would run for a plan.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
candidateNoFor a comparison, the candidate whose script to return. Null for the best one.
object_idYesId of a plan (its forecasting script), a cross-validation strategy (the code that builds it), a backtest, a forecast or a comparison (the script that ran).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
codeYes
kindYes
filesNo
candidateNo
requirementsNo
code_truncatedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, destructiveHint=false and a closed world, so the safety profile is covered. The description does add one real behavioral fact ('would run for a plan' implies no executed script exists for plans), but it says nothing about permissions, script size, or what happens for objects with no associated code, which matters given the broad object_id scope.

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?

A single front-loaded sentence with zero filler; the colon construction keeps the core action first and the qualification second. Slightly compressed, but every clause earns its place.

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?

An output schema exists, annotations cover safety, and all parameters are documented, so the description need not explain return values. The only remaining gap is the absence of explicit routing against the object-inspection siblings, which is minor for a tool this simple.

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

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both object_id (plan, CV strategy, backtest, forecast, comparison) and candidate (the comparison candidate, null for the best). The description adds no parameter-level meaning beyond that, which is the correct baseline when the schema does the heavy lifting.

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+resource ('Return the Python script of an object') and adds the discriminating nuance that it is the script that ran, or the one that would run for a not-yet-executed plan. This clearly separates it from metadata-style siblings like describe_object and list_objects, though it never names those siblings.

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: retrieve code when you need the actual script rather than a description. There is no explicit 'use this instead of describe_object' routing, no mention of prerequisites, and no when-not-to-use guidance, even though sibling tools clearly overlap in the object-inspection space.

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