cantrip_meter_history
View recent credit transactions including usage debits and purchases to track running balance. Override project settings for cloud-hosted or multi-project environments.
Instructions
View recent credit transactions. Shows usage debits, purchases, and running balance. Pass project to override .cantrip.json — useful in cloud-hosted or multi-project contexts.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum entries to return (default: 20) | |
| project | No | Project slug — overrides .cantrip.json. Required in environments where cantrip_connect cannot write to the filesystem. |
Implementation Reference
- src/tools.ts:437-440 (handler)The handler function executes the tool logic by resolving the project and calling client.post with 'meter history' command, passing the limit parameter
handler: async (p) => { const project = resolveProject(p.project as string | undefined); return client.post("meter", ["history"], { ...buildFlags({ limit: p.limit }), project }); }, - src/tools.ts:433-436 (schema)Input schema defining optional 'limit' parameter for max entries (default 20) and optional 'project' parameter for project slug override
shape: { limit: z.number().optional().describe("Maximum entries to return (default: 20)"), project: projectSchema, }, - src/tools.ts:428-441 (registration)Complete tool definition registration including name, description, input schema, and handler function for viewing credit transaction history
{ name: "cantrip_meter_history", description: "View recent credit transactions. Shows usage debits, purchases, and running balance." + PROJECT_DESC_SUFFIX, shape: { limit: z.number().optional().describe("Maximum entries to return (default: 20)"), project: projectSchema, }, handler: async (p) => { const project = resolveProject(p.project as string | undefined); return client.post("meter", ["history"], { ...buildFlags({ limit: p.limit }), project }); }, },