Skip to main content
Glama

One function's score across runs

get_function_history
Read-onlyIdempotent

Check a function's historical CRAP score, coverage, and complexity across past runs to tell whether it is improving, decaying, or regrown.

Instructions

Returns one function's ccn, coverage, crap and flag in every run that measured it, oldest first, plus its ratchet mark. Use it to tell improving from decaying or regrown, and get_function_brief instead 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 resolves off the newest run that scored path, so a substring such as "eval" fans out to one entry per long name matched, and repo may be any directory under the measured checkout.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesthe 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
pathYesrepo-relative source file, forward slashes
repoNopath to the scored repo's root (default: the repo the server was started in)
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

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.6.0

TDQS

A4.9/5.0
Behavior5/5

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

Beyond the readOnly/idempotent annotations, the description discloses meaningful behaviors: results are ordered oldest first, history spawns git log -L capped at 10 commits, tests is null unless contexts were recorded, and name resolution uses the newest run scoring path with substring fan-out. This adds real behavioral context the annotations alone do not provide.

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 front-loaded with the core return value and usage, and every sentence contributes useful information. It is somewhat dense, especially in the trailing clauses about history/tests/name/repo, but remains well-structured and not padded.

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?

With an output schema present, the return shape is already covered. The description completes the picture by specifying ordering, optional-parameter behavior, name resolution rules, repo scope, and the sibling alternative. An agent has enough context to invoke this tool correctly without further inference.

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 description adds important semantic details beyond the parameter descriptions: history's git log cap, tests' null behavior, name's newest-run resolution and substring fan-out, and repo's flexibility to any directory under the checkout. This materially helps an agent choose and format parameter values correctly.

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 action and resource: it returns one function's ccn, coverage, crap, flag, and ratchet mark across runs, oldest first. This clearly distinguishes the tool from siblings like get_function_brief and get_trend by focusing on per-run history for a single function.

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?

The description explicitly says to use this tool to tell improving from decaying or regrown functions, and to use get_function_brief instead when starting an edit. This gives the agent both a positive use case and a concrete alternative, satisfying the when/when-not guidance requirement.

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