Skip to main content
Glama

Debt trend per run

get_trend
Read-onlyIdempotent

Track the repo's CRAP score trajectory across all trusted runs, oldest first, with per-scope grades. See whether overall code health improves or declines over time.

Instructions

Returns per-run totals for every trusted run, oldest first, with a grade per scope. Use it for the whole repo's trajectory. Use get_function_history for one function and get_ratchet_report for marked debt. It runs no lane and spawns no git. The first call on a large store sums every run into a rollup cache and takes seconds. Later calls read the cache back. repo may be any directory under a checkout where crapkit init and crapkit coverage have run. An unmeasured one answers isError true with the setup pointer.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repoNopath to the scored repo's root (default: the repo the server was started in)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
runsNoone row per trusted run, oldest first
schemaNopayload schema version, 1
targetNothe [crapkit] target: the default ccn ceiling every scope inherits unless it sets its own

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?

Annotations already mark this as read-only, idempotent, and non-destructive, and the description adds useful behavior beyond that: first call on a large store builds a rollup cache and takes seconds, later calls read the cache, and unmeasured repos return isError true with the setup pointer. No contradiction with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Every sentence carries distinct information: core behavior, usage selection, side-effect profile, performance characteristics, parameter prerequisites, and error behavior. The description is front-loaded with the main result and purpose, with no filler.

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?

Given the simple schema, rich annotations, and presence of an output schema, the description covers all critical context: when to use it, alternatives, behavioral quirks, performance expectations, and failure mode. An agent has everything needed to select and invoke this tool correctly.

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 adds meaningful parameter context: repo may be any directory under a checkout where crapkit init and crapkit coverage have run. This clarifies allowed values beyond the schema's path-to-root wording.

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: returns per-run totals for every trusted run with a grade per scope, ordered oldest first. It also names sibling tools for different cases, making the distinction explicit.

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 for the whole repo's trajectory and directs to get_function_history for one function and get_ratchet_report for marked debt. It also states the prerequisite that crapkit init and crapkit coverage must have run, and notes it runs no lane and spawns no git.

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