Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
CODEX_HOMENoOverrides the Codex CLI home directory (default ~/.codex).
XDG_CONFIG_HOMENoOverrides the base config directory for Claude Code (and other tools).
CLAUDE_CONFIG_DIRNoOverrides the Claude Code configuration directory (default ~/.claude).
OPENCODE_DATA_DIRNoOverrides the OpenCode local data directory (default ~/.local/share/opencode/storage/).
TEAMSPEND_COPILOT_ORGNoYour GitHub org login.
TEAMSPEND_CURSOR_TOKENNoCursor Admin API key.
TEAMSPEND_COPILOT_TOKENNoGitHub token with read:org scope or fine-grained 'View Organization Copilot Metrics' permission.
TEAMSPEND_CLAUDE_CODE_TOKENNoAnthropic Admin/Analytics API key.
TEAMSPEND_COPILOT_SEAT_PRICE_USDNoOptional flat seat price per user for Copilot; if set, added once per active user for the whole comparison window.

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
runA

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.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

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