trazum
v3.0.6Trazum as an MCP server: let an agent price and budget its own prompts before it sends them.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
spend_guard May I spend this? — with the cheaper way if not
Call this before making a model call, when a budget exists and you do not know whether this call fits inside it. Answers yes, no, or cannot-tell. Where the numbers come from: the ceilings are in trazum.config.json in the working directory (spend.maxUsd, spend.monthlyUsd, the limits block), and the spend so far is in the usage log the host already writes. Read both yourself and pass the figures: this server never opens a file. Without a ceiling somebody set the answer is cannot-tell, never a yes nobody measured. A refusal carries the cheaper ways to make the same call (a smaller model the promp…
| Parameter | Type | Description |
|---|---|---|
inputTokens * | integer | Input tokens the call would send, including anything cached. |
model * | string | Model id the call would go to. Call list_models for what is known. |
batchEligible | boolean | Whether this work can wait for a batch window. Only you know that, so batch alternatives are offered only when you say so. |
consumedUsd | number | Measured spend so far, in dollars — from a bill, never a guess. Omit it and the answer is cannot-tell rather than a yes nobody measured. |
label | string | The workload this call belongs to, for the per-label ceiling. |
limitUsd | number | The budget this is judged against. Omit it and the answer is cannot-tell: this tool reports a position against a policy a human set, and never invents one. |
limits | object | The limits policy from trazum.config.json — {"dayUsd": n, "sessionUsd": n, "byLabel": {"name": n}}, positive dollars. Judged by the same function the gateway and trazum serve use, so the three doors… |
outputTokens | integer | Output tokens you expect back. Left at zero, the answer prices input only and says so by carrying the figure you gave. |
position | object | Measured spend per scope, from your own usage log — never a guess. A scope you omit is unmeasured and its ceiling answers cannot-tell, not "under". |
session | string | The conversation this call belongs to, for the per-session ceiling. Used to judge and never echoed back. |
waive | array | The waive list from trazum.config.json — [{"gate": "limits.sessionUsd", "reason": "...", "until": "YYYY-MM-DD"}]. A waived ceiling still reports its measurement, but a crossed one answers yes with t… |
check_prompt Check a prompt against a token budget
Answers whether a prompt fits a maximum, and if not, whether optimising it would. maxTokens comes from the budgets block of trazum.config.json, matched against the prompt's path; read it yourself, since this server never opens a file. Without a budget somebody set there is nothing to check and this is not the tool to call. Offline and free: no model is called.
| Parameter | Type | Description |
|---|---|---|
maxTokens * | integer | The budget. Required: a check with no maximum is not a check. |
prompt * | string | The prompt text itself. This server never reads files. |
level | string | safe leaves meaning untouched; aggressive also rewords, and wants reading |
optimize_prompt Optimise a prompt and price the difference
Applies Trazum's deterministic rules to a prompt and returns the shorter text, the token counts either side, what the difference is worth per month, and any advisories. Offline and free: no model is called.
| Parameter | Type | Description |
|---|---|---|
prompt * | string | The prompt text itself. This server never reads files. |
avgOutputTokens | integer | |
callsPerMonth | integer | Used only to scale the figures |
level | string | safe leaves meaning untouched; aggressive also rewords, and wants reading |
model | string | Model id used for pricing. Call list_models for what is known. |
import_usage Import native agent usage from transcript text
Converts explicit Claude Code, Codex or Gemini CLI session text into normalized JSONL for profile_usage and plan_savings. Returns conversion diagnostics, never subscription billing or a completeness guarantee. No files, network or writes; prompt/tool/path content is excluded. Session identifiers remain. Labels are explicit only.
| Parameter | Type | Description |
|---|---|---|
format * | string | |
text * | string | Transcript JSONL contents, never a path. Import one source at a time; separate calls do not share deduplication state. |
label | string | Optional caller-approved workload label. Never derived from cwd or filenames. |
analyze_task Analyze explicit agent task transcripts
Analyze caller-supplied Claude Code or Codex transcript text for one task. Return bounded token evidence, repeated tool-call findings with source/line references, and a fixed review policy when actionable findings exist. Reads no files and applies no policy. Outcome and assessor are caller assertions, never inferred from tokens. Task metadata is retained; raw transcript content is not returned.
| Parameter | Type | Description |
|---|---|---|
criterion * | string | Caller-approved acceptance criterion. Retained in the report; exclude sensitive text. |
sources * | array | Explicit transcript contents for this task. Combined text limit: 400000 characters. No path discovery. |
taskId * | string | |
taskType * | string | |
assessor | string | Caller-approved assessment label, required for accepted or rejected outcomes. Retained in the report. |
outcome | string | |
policyId | string |
compare_tasks Compare recorded task outcomes and token evidence
Compare two saved task report JSON strings from analyze_task or trazum task. Refuse malformed reports and retain comparability gates, outcome assertions and evidence gaps. Lower recorded tokens alone do not prove equal quality, causal improvement or realized savings. No files, network, model calls or writes.
| Parameter | Type | Description |
|---|---|---|
after * | string | JSON.stringify of the later report field. Combined before/after limit: 400000 characters. |
before * | string | JSON.stringify of the baseline report field, not the analyze_task envelope or a path. |
profile_usage Where the money went, from a usage log
Reads a usage log — one JSON object per line, each with a "model" and the "usage" object the API returned — and says where the money went: the spend split, per label and per model, whether caching paid for itself, and which levers would actually move the bill. These are the provider's own billed token counts, not estimates. Pass the log text itself: this server never reads files. Add "label", "session" and "ts" fields to the records to unlock the per-workload findings, conversation growth, the period the log covers, and whether the cache TTL fits how fast the turns arrive; the session key…
| Parameter | Type | Description |
|---|---|---|
log * | string | The usage log text, one JSON object per line. Never a file path. A Claude Code, Codex or Gemini CLI session is not one: convert it with import_usage first. |
label | string | Profile only the calls carrying this label — the drill-down once the full report named a suspect. A label matching nothing is an error naming the labels that exist. |
previous_log | string | A previous usage log to compare against, as text — never a file path. Positive means the bill grew. Drivers of the change are named per label and per model, appeared and vanished workloads included;… |
pricing_overlay | string | The same JSON document a --pricing overlay file holds, passed as text — never a file path. Adds models the bundled catalogue does not know and overrides prices for ones it does; every figure in the… |
since | string | Profile only calls at or after this moment: a UTC day (2026-08-14) or a full ISO 8601 timestamp. Calls with no "ts" cannot be placed and are excluded, counted out loud — never dropped silently. |
until | string | Profile only calls up to this moment; a bare date includes that whole UTC day. A window matching nothing is an error naming what the log does cover. |
what_if | string | Price these exact calls on another model id. The same token counts at a different rate card — multiplication, not advice: it says nothing about whether that model could do the work. Calls larger tha… |
plan_savings Rank savings actions from recorded usage
Builds the same plan as trazum plan from normalized log text. Returns JSON with a plan and evidence: projected savings and measured stakes stay separate, assumptions and pricing gaps remain explicit. No model, network or file access.
| Parameter | Type | Description |
|---|---|---|
log * | string | Normalized usage-log text, one JSON object per line. Never a path. A Claude Code, Codex or Gemini CLI session is not one: convert it with import_usage first. |
pricing_overlay | string | Optional pricing-overlay JSON text. Use the same rates for planning and verification. |
verify_savings Check a saved plan against later usage
Verifies the plan JSON text against newer normalized log text using trazum verify logic. Returns arrived, not-arrived or cannot-tell per action, attribution and gate failures. A vanished workload does not count as savings; a route+batch result cannot prove batch billing.
| Parameter | Type | Description |
|---|---|---|
log * | string | Normalized usage-log text, one JSON object per line. Never a path. A Claude Code, Codex or Gemini CLI session is not one: convert it with import_usage first. |
plan * | string | The JSON text of the plan field returned by plan_savings, or a saved trazum plan document. Never a path. |
pricing_overlay | string | Optional pricing-overlay JSON text. Use the same rates for planning and verification. |
position Where the month stands, measured — no forecast
States the month's measured position against every ceiling you pass: monthly budget, per-day limit, per-label limits. Measured from the log text alone, priced record by record, with the denominator on every figure — days measured against days elapsed. The distance line is division on the past, labelled as such, and absent under the seven-day floor, on an over, and on a zero rate: this tool never forecasts. Ceilings the log cannot measure are named with the reason instead of skipped. Pass the log text itself: this server never reads files, and session keys are never shown.
| Parameter | Type | Description |
|---|---|---|
log * | string | The usage log text, one JSON object per line. Never a file path. A Claude Code, Codex or Gemini CLI session is not one: convert it with import_usage first. |
limits | object | The limits policy from trazum.config.json — {"dayUsd": n, "sessionUsd": n, "byLabel": {"name": n}}. Validated like the config file itself. |
monthlyUsd | number | The calendar-month budget, in dollars — spend.monthlyUsd from the config. |
list_models Models Trazum can price, and their rates
Input and output price per million tokens, context window and cacheable minimum, for every model in the bundled catalogue.
prompt_writer Interviews you, then writes the prompt
Asks what a good prompt needs and assembles one from your answers. Call it with the answers you have; it returns the next question worth asking, what is still missing, and the prompt once the required answers are in. Nothing is generated — the questions are fixed and the words in the prompt are yours, so the same answers always produce the same text. An answer of null is a decline, which is an answer: it is recorded and the follow-up it would have opened is not asked. The draft carries what it costs (estimated, and it says so), whether it fits a budget you state, and what trazum optimize can…
| Parameter | Type | Description |
|---|---|---|
answers * | object | What you know so far, keyed by question id. Start with {} to be asked the first one. A value of null declines that question. Unknown ids are refused rather than ignored. |
avgOutputTokens | integer | Output tokens you expect back per call, for the same estimate. |
callsPerMonth | integer | Calls per month, for the cost estimate. Nothing is priced without it. |