Skip to main content
Glama

Log item usage

log_item_usage

Attribute AI usage to a work item (todo/event) — increments its cached ai_calls / tokens / cost rollup (§2.8).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "subject_type": "<subject_type>",
      "subject_id": "<subject_id>"
    },
    "name": "log_item_usage"
  }
}

Input Schema

NameRequiredDescriptionDefault
callsNoNumber of calls (default 1).
tokensNoTotal tokens for this call.
cost_usdNo
subject_idYes
subject_typeYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false and idempotentHint=false, so the mutation/non-idempotent profile is known. The description adds genuine context beyond that: it increments cached ai_calls/tokens/cost rollups, which tells the agent the effect is cumulative and that repeated calls compound values. It does not say what happens on an invalid subject_id or whether the rollup is eventually consistent.

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?

A single front-loaded sentence with the effect stated directly after the action. The trailing spec reference (§2.8) is the only non-essential token and costs nothing.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a five-parameter mutation tool with no output schema, the description covers the core action and its side effect but leaves parameter-level detail thin and silent on failure modes. An agent could invoke it, but would be guessing on subject_id validity and cost units.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is only 40% — calls and tokens are documented, but cost_usd, subject_id, and subject_type are not. The description partially compensates by mapping 'todo/event' to subject_type and tying ai_calls/tokens/cost to the rollup fields, but it adds nothing about subject_id format or units for cost_usd.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: 'Attribute AI usage to a work item (todo/event)', and names the constrained entity types. It is clearly distinct from reporting tools like get_usage_report, though it never names a sibling explicitly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is only implied — an agent can infer it should call this when recording AI consumption against a todo or event. There is no stated when-not guidance, no mention of how this differs from get_usage_report, and no note on whether the subject must already exist.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources