Skip to main content
Glama
MerchantGuard

agentguard

Official

set_model_cost

Register a model's pricing in cents per 1,000 tokens for input and output to enable spend tracking and prevent failed-closed denials for self-hosted models.

Instructions

Register a cost for a model with no built-in pricing (required for self-hosted models: AgentGuard fails closed on unknown costs). Cents per 1,000 tokens. Optional agent_id, task_id and workflow_id accept identifiers only; spend_decide binds them into the signed actor. Read-only and cost-configuration tools accept these fields without recording a spend decision.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelYes
task_idNoOptional task identifier; signed as actor.taskId on spend_decide
agent_idNoOptional agent identifier; signed as actor.agentId on spend_decide
workflow_idNoOptional workflow identifier; signed as actor.workflowId on spend_decide
input_cents_per_ktokYes
output_cents_per_ktokYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.1

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations provided, the description carries the behavioral burden. It discloses the fail-closed behavior, the pricing unit (cents per 1,000 tokens), and the semantics of optional identifiers being bound into the signed actor by spend_decide. It could mention idempotency or update behavior, but it is transparent about key side effects.

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?

The description is compact and well-structured: purpose first, required behavior next, optional parameter semantics last. Every sentence adds information without repetition or filler.

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

Completeness4/5

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

For a six-parameter tool with no output schema and no annotations, the description covers the essential context: when registration is needed, the pricing unit, fail-closed behavior, and how optional identifiers are used downstream. It does not describe return values or error cases, but the schema plus description are sufficient for correct invocation.

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

Parameters4/5

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

Schema coverage is only 50%, so the description must compensate. It adds crucial meaning for the two pricing parameters by specifying 'Cents per 1,000 tokens', and clarifies that optional IDs accept identifiers only. This adds value beyond the schema's type and pattern constraints.

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 states a specific verb and resource: 'Register a cost for a model with no built-in pricing'. It also distinguishes itself from the sibling spend/provenance tools by clarifying this is a cost-configuration action, not a spend decision or read operation.

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

Usage Guidelines4/5

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

It gives clear usage context: required for self-hosted models and AgentGuard fails closed on unknown costs. It does not explicitly name an alternative tool or a when-not-to-use condition, but the context is strong enough to guide selection.

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