Skip to main content
Glama

ck_cost_optimizer

Analyze spending patterns to suggest cost optimizations, or compare AI provider and model prices for a task to reduce costs before selection.

Instructions

Get cost optimization suggestions or compare AI provider/model prices for a task. Read-only — no budget records are written (use ck_budget to record actual spend). Two modes: suggest returns optimization tips based on recent session spending patterns; compare returns a side-by-side price breakdown for the given task. For suggest mode, pass session_id. For compare mode, pass task_description and estimated_tokens along with top_provider and top_model as the baseline. Use ck_cost_optimizer before choosing a model for expensive multi-agent work; use ck_budget to record and enforce spend limits.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
estimated_tokensNo
modeYesOperation mode that determines the tool behavior and return shape.
session_idNoUnique session identifier for correlating findings, proofs, budget, and audit trail.
spendingNo
task_descriptionNoTask description for cost estimation.
top_modelNoPrimary model for cost comparison.
top_providerNoPrimary provider for cost comparison.
Behavior4/5

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

With no annotations, the description carries full burden. It states read-only, no budget writes, and explains two modes' behaviors. Could mention error handling or return format more explicitly, but is generally good.

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?

Five sentences, no fluff. Front-loaded with purpose, then mode details, then usage guidance. Every sentence adds value.

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?

Good coverage of modes and parameter mapping, but lacks description of the 'spending' parameter, and no explicit return format despite no output schema. Adequate but with gaps.

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 71%, but description adds value by mapping parameters to modes: for suggest mode pass session_id, for compare mode pass task_description, estimated_tokens, top_provider, top_model. This compensates for missing parameter descriptions in schema.

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 clearly states the tool's dual purpose: getting cost optimization suggestions or comparing AI provider/model prices. It differentiates from sibling ck_budget by emphasizing read-only nature.

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?

Explicitly tells when to use this tool versus ck_budget: 'Use ck_cost_optimizer before choosing a model... use ck_budget to record and enforce spend limits.' Also distinguishes between suggest and compare modes.

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

Install Server

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/aryaminus/controlkeel'

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