Skip to main content
Glama

call_function

Read-only

Execute any registered StatsPAI function by name with keyword arguments to access functions not exposed as individual tools; pass dataset handles and chain results via result IDs.

Instructions

Run ANY registered StatsPAI function by name with keyword arguments -- the escape hatch for the ~1,200 functions that are not individually listed as tools. arguments follows the parameter schema from describe_function; column names refer to the dataset passed as data_id / data_path. An argument the function does not accept refuses the call (error_kind unknown_argument, with did_you_mean). Supports as_handle / result_id chaining like every other tool.

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": {
      "function": "<function>"
    },
    "name": "call_function"
  }
}

Input Schema

NameRequiredDescriptionDefault
detailNoPayload depth; agent is the fullest.agent
data_idNoData handle (d_...) from load_data; replaces data_path.
data_csvNoSmall inline table as CSV text.
functionYesRegistered function name (sp.<name>).
argumentsNoKeyword arguments for the function (JSON object).
as_handleNoCache the fit and return its result_id.
data_pathNoAbsolute path of a data file on the server.
result_idNoHandle of an earlier fit made with as_handle=true.
data_columnsNoLoad only these columns.
data_recordsNoSmall inline table as row objects.
data_sample_nNoUniform random subsample of this many rows (seed 0).
max_output_bytesNoResult byte budget (default 262144; 0 = none).

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, so the safety profile is covered; the description still adds real behavior: unknown arguments are refused with error_kind unknown_argument plus did_you_mean, and as_handle/result_id chaining works as in other tools. It does not describe payload depth behavior (the detail enum) or output budgeting, which remain schema-only.

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 three tightly packed sentences covering argument mapping, error behavior, and chaining. Dense but every clause carries information; the backticked identifiers add precision rather than noise.

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 12-parameter generic dispatcher with an output schema and full schema coverage, the description covers the essential unknowns: what name space `function` draws from, how `arguments` is shaped, how data binding works, and what failure looks like. The remaining detail is appropriately delegated to describe_function and the schema.

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, but the description earns above that by explaining that `arguments` mirrors the schema returned by describe_function and that column names inside it resolve against whichever dataset is supplied via data_id/data_path. That is non-obvious semantics an agent could not infer from the schema alone.

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 ('run ANY registered StatsPAI function by name with keyword arguments') and immediately scopes it as 'the escape hatch for the ~1,200 functions that are not individually listed as tools'. That framing clearly separates it from the dedicated siblings like feols, ivreg, and rdrobust without needing to enumerate them.

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

Usage Guidelines4/5

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

Gives a clear selection rule: use this for functions without a dedicated tool, and consult describe_function to obtain the parameter schema before calling. The complementary case (prefer the dedicated tool when one exists) is implied by 'escape hatch ... not individually listed' rather than stated as an explicit exclusion.

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