Skip to main content
Glama

run

Compare AI coding tool spend across two tools for a before vs. after date range, pulling real numbers from each vendor's API or local session logs.

Instructions

Compare AI-coding-tool spend between a "before" and "after" date window across two tools, using each vendor's own admin/analytics API (or local session logs for the credential-free claude-code-personal mode) so the result is a real reported number, not an estimate. Call this when a user asks things like "did switching from Cursor to Claude Code save us money" or "what did our AI coding spend look like before vs. after we rolled out Copilot" -- it answers exactly that comparison in one shot. Do not call it for anything outside a two-tool before/after cost comparison (e.g. general usage analytics, per-line-item billing detail, or tools other than cursor, claude-code, claude-code-personal, copilot, opencode, codex).

Prerequisites: the two admin API tokens for whichever tools are being compared must already be set as environment variables in the server's process (e.g. TEAMSPEND_CURSOR_TOKEN, TEAMSPEND_CLAUDE_CODE_TOKEN, TEAMSPEND_COPILOT_TOKEN + TEAMSPEND_COPILOT_ORG); claude-code-personal needs no token since it reads local session logs instead. Missing credentials do not raise an exception -- the tool still returns successfully, with a DataUnavailableError recorded against the affected side (see below) so the caller can see exactly what's missing.

Behavioral notes: this makes outbound network calls to the relevant vendor APIs (skipped for claude-code-personal) and is read-only against the user's own systems, but it also writes a teamspend-snapshot-*.json report file to disk in the current working directory on every run (contains per-user email and spend data, permissions set to owner-only 0600). Each call is independent and idempotent -- rerunning with the same args re-fetches fresh data and overwrites the report file, it never accumulates state across calls. On a CLI crash or non-zero exit, the returned dict carries an error key plus the captured stderr and the exact command that was run, rather than raising.

Parameter: args is a list[str] of argv exactly as they'd appear on the teamspend command line -- --json is appended automatically and must not be included. Required flags are --tools <a>,<b> (exactly two of: cursor, claude-code, copilot, opencode, claude-code-personal, codex) and --before/--after as YYYY-MM-DD:YYYY-MM-DD ranges. Optional flags: --before-csv/--after-csv <path> to backfill a window an API can't reach, --breakdown session for a per-session cost breakdown. Real examples: ["--tools", "cursor,claude-code", "--before", "2026-04-01:2026-04-30", "--after", "2026-06-01:2026-06-30"] ["--tools", "claude-code-personal,opencode", "--before", "2026-01-01:2026-01-31", "--after", "2026-02-01:2026-02-28", "--breakdown", "session"] ["--help"] (discovers every supported flag and tool name directly from the CLI, without a code change)

Returns a dict parsed from the CLI's own --json output with keys before and after (each {label, tool, result, error}, where result is null and error is populated when that side's data was unavailable), plus top-level deltaUsd, deltaPercent, and topSpendersAcrossBoth.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
argsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Install Server

TDQS

A4.9/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden and does so thoroughly. It discloses outbound network calls, read-only nature, file write side effects (including permissions 0600), idempotency, error handling on CLI crash, and the behavior around missing credentials. This is far beyond typical transparency.

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 long but well-structured with clear paragraphs and a logical flow. Every sentence provides meaningful information, though a few phrases like 'it answers exactly that comparison in one shot' add little and could be trimmed. The length is justified for the tool's complexity, but it isn't maximally concise.

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 tool's complexity, the description covers all essential context: prerequisites, side effects, parameter details, error behavior, return value structure, and explicit usage constraints. An output schema exists, but the description still explains return keys, which is helpful for an agent understanding the data shape without relying solely on the schema.

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?

The input schema only has 'args' as an array of strings with no description, so schema coverage is 0%. The description fully compensates by explaining the exact expected argv format, required flags, optional flags, automatic --json appending, --help usage, and three real examples. This is exemplary parameter documentation.

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 opens with a precise, specific verb and resource: 'Compare AI-coding-tool spend between a "before" and "after" date window across two tools.' It clearly distinguishes itself from other tools by explicitly listing what it does not handle ('general usage analytics, per-line-item billing detail, or tools other than cursor, claude-code, claude-code-personal, copilot, opencode, codex').

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 provides explicit when-to-use guidance with concrete example user queries, and also gives an explicit when-not-to-use list. It even states the exclusions in detail, making the decision boundary extremely clear.

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

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/RudrenduPaul/teamspend'

If you have feedback or need assistance with the MCP directory API, please join our Discord server