Skip to main content
Glama

One function's score across runs

get_function_history
Read-onlyIdempotent

Retrieve a function's complexity, coverage, and crap scores across runs, oldest first, to determine if it's improving, decaying, or regrown. Optionally include git commit history and test contexts.

Instructions

Returns one function's ccn, coverage, crap and flag per run, oldest first, plus its ratchet mark. Use it to tell improving from decaying or regrown, and get_function_brief to start an edit. history true spawns git log -L capped at 10 commits, and tests true is null unless the lane recorded contexts. name matches the long names any run scored in path, so a fragment returns one entry per match, and a bare twin name picks the worst twin. A same-line twin's history skips runs stored before same-line positions. repo may be any directory under the checkout.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesthe long_name get_next_item printed (classify( score , late )), the bare identifier (classify, or route for a Rust `route cmd : & Cmd`), a fragment of either, the line the function starts on, or a handle such as NAME#2 for a twin or (anonymous)#2; exact match first
pathYessource file, repo-relative or absolute inside the repo; a backslash separates folders on Windows only
repoNopath to the scored repo's root (default: the repo the server was started in); a leading ~ is the home directory
testsNoalso list the tests covering this function (coverage.py contexts), as tests
historyNoalso list the commits that touched this function (git log -L), as commits

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNothe name argument as given
pathNothe file asked about
schemaNopayload schema version, 1
functionsNothe functions name resolved to, in store order
truncatedNopresent only when the whole answer was longer than one tool result the server sends (7,500 characters): each list, string or object field it cut, at any depth, keeps its start, and full is the CLI command that prints the whole answer

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changedv0.8.1
    • changedInput schema / properties / name / description
      Previous value: -"the bare identifier (classify, or route for a Rust `route cmd : & Cmd`) or the whole long_name get_next_item printed (classify( score , late )); both resolve, exact match first"New value: +"the long_name get_next_item printed (classify( score , late )), the bare identifier (classify, or route for a Rust `route cmd : & Cmd`), a fragment of either, the line the function starts on, or a handle such as NAME#2 for a twin or (anonymous)#2; exact match first"
    • changedInput schema / properties / path / description
      Previous value: -"repo-relative source file, forward slashes"New value: +"source file, repo-relative or absolute inside the repo; a backslash separates folders on Windows only"
    • changedInput schema / properties / repo / description
      Previous value: -"path to the scored repo's root (default: the repo the server was started in)"New value: +"path to the scored repo's root (default: the repo the server was started in); a leading ~ is the home directory"
    • changedOutput schema / properties / functions / items / properties / history / items / properties / cov / description
      Previous value: -"branch coverage 0.0 to 1.0; null on an inventory run"New value: +"branch coverage inside the span, 0.0 to 1.0; statement coverage when the span has no branches, and invoked-or-not (1.0 or 0.0) when it has no statements; Python and/or add to ccn but coverage.py records no branch arc for them; 0.0 on an untested, excluded, no-lane or cc-only row; null on an inventory run"
    • changedOutput schema / properties / functions / items / properties / history / items / properties / crap / description
      Previous value: -"score; null on an inventory run"New value: +"score: ccn^2 x (1 - cov)^3 + ccn, or ccn on a cc-only or excluded row; null on an inventory run"
    • changedOutput schema / properties / functions / items / properties / history / items / properties / flag / description
      Previous value: -"measured, untested, no-lane or cc-only; null on an inventory-only run"New value: +"measured, untested, excluded, no-lane or cc-only; null on an inventory-only run"
    • changedOutput schema / properties / functions / items / properties / history / items / properties / flag / enum
      Previous value: -[
      -  "measured",
      -  "untested",
      -  "no-lane",
      -  "cc-only",
      -  null
      -]New value: +[
      +  "measured",
      +  "untested",
      +  "excluded",
      +  "no-lane",
      +  "cc-only",
      +  null
      +]
    • addedOutput schema / properties / truncated
      Added value: +{
      +  "description": "present only when the whole answer was longer than one tool result the server sends (7,500 characters): each list, string or object field it cut, at any depth, keeps its start, and full is the CLI command that prints the whole answer",
      +  "properties": {
      +    "fields": {
      +      "additionalProperties": {
      +        "properties": {
      +          "kept": {
      +            "description": "how many the answer keeps",
      +            "type": "integer"
      +          },
      +          "of": {
      +            "description": "how many the whole answer has",
      +            "type": "integer"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "description": "each cut field, named by its keys joined with dots (gate.breaches) -> kept and of: elements for a list, entries for an object, characters for a string",
      +      "type": "object"
      +    },
      +    "full": {
      +      "description": "the crapkit command that prints the whole answer, spelled for the server's shell",
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
  2. Addedv0.6.0

TDQS

A4.5/5.0
Behavior5/5

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

Annotations only cover the safety profile (readOnly, idempotent, non-destructive). The description adds substantial behavior beyond them: history caps git log -L at 10 commits, tests is null unless the lane recorded contexts, same-line twins skip runs stored before same-line positions. These are exactly the runtime quirks an agent needs to interpret results.

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 return content and the routing decision, then dense caveats. Every sentence carries information, though the middle section is tightly packed and reads as a run-on chain of edge cases.

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?

Output schema exists so return values need not be explained, yet the description still names the returned metrics and ordering ('oldest first'). For a 5-param tool with twin-matching complexity, the behavioral coverage is strong; only explicit prerequisites or error behavior are absent.

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 description coverage is 100%, so baseline is 3. The description adds meaning beyond the schema: name fragments return one entry per match, a bare twin name picks the worst twin, and repo may be any directory under the checkout. This is genuine cross-parameter behavior the schema fields do not spell out.

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 ('Returns one function's ccn, coverage, crap and flag per run') and names the exact differentiator versus the sibling get_function_brief ('get_function_brief to start an edit'). An agent can distinguish this from get_function_brief and get_trend without opening either schema.

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 explicit when-to-use ('Use it to tell improving from decaying or regrown') and routes to the alternative for the adjacent task ('get_function_brief to start an edit'). No explicit when-not or prerequisites section, so it stops short of a 5.

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