Skip to main content
Glama

Define derived series

define_derived
DestructiveIdempotent

Create or replace a derived series, computed from other series every time it is read (always fresh, stores no points, counts toward the series limit). definition: {"op":"add"|"subtract"|"multiply"|"divide","a":series,"b":series} (matched by date) | {"op":"pct_change"|"diff"|"moving_average"|"rolling_min"|"rolling_max"|"shift","a":series,"n"?:1-1000} (shift: the value n points earlier) | {"op":"scale","a":series,"factor":number} | {"op":"resample","a":series,"to":"M"|"Q","how"?:"last"|"mean"|"sum"|"ffill"} (to month/quarter ends; ffill also fills gaps up to today) | {"op":"mean"|"sum","inputs":[2-20 series]} (dates all inputs have) | {"op":"status","a":series,"red"?:[rule],"yellow"?:[rule]} → text labels red/yellow/green (red if any red rule holds, else yellow if any yellow rule, else green); rule: {"series"?:name (default a; read as of each date of a),"above"|"below":number,"for"?:1-24 (holds for the last k points)} or {"all":[2-10 rules]}; at most 10 rules | {"op":"composite","inputs":[status series],"min_inputs"?:n} → 0-100 score (red 2, yellow 1, green 0) | {"op":"count","inputs":[status series],"value":"red"|"yellow"|"green","share"?:true (percent)}. Inputs may themselves be derived (up to 10 levels; one read may touch at most 200 stored series). Example: a yield-curve spread {"op":"subtract","a":"govt_10y","b":"tbill_3m"}.

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": {
      "series": "<series>",
      "definition": "<definition>"
    },
    "name": "define_derived"
  }
}

Input Schema

NameRequiredDescriptionDefault
seriesYesname for the derived series
definitionYesdefinition

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Beyond annotations, it discloses important behavioral traits: the series is always fresh, stores no points, counts toward the series limit, derived inputs may nest up to 10 levels, and one read may touch at most 200 stored series. These details materially help an agent understand the consequences of replacement and query complexity.

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?

The description is dense and front-loads the core behavior before the DSL specification. The length is justified by the complex definition object, though the long semicolon-separated DSL could be easier to scan if structured more explicitly.

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?

For a complex nested-object tool with no output schema, the description covers creation/replacement behavior, freshness/storage semantics, limits, and the entire definition DSL. It gives an agent enough to call the tool correctly.

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

Parameters5/5

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

Although schema coverage is 100%, the schema only says definition is an object. The description supplies the full DSL semantics for every operation, rule structure, defaults, and limits, adding substantial meaning beyond the schema.

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?

The description states a specific verb and resource: 'Create or replace a derived series.' It immediately clarifies the defining behavior—computed from other series on every read—which distinguishes it from stored-series tools like get_series or delete_series.

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?

It clearly indicates when to use the tool: to create or replace a derived series, with useful context that the result is always fresh and stores no points. It does not explicitly name alternatives or when not to use it, so it stops short of full routing guidance.

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.