Skip to main content
Glama

ck_cost_optimizer

Read-onlyIdempotent

Get cost optimization suggestions from recent spending patterns or compare AI provider/model prices for a task to lower costs.

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
modeYesOperation mode that determines the tool behavior and return shape.
spendingNo
top_modelNoPrimary model for cost comparison.
session_idNoUnique session identifier for correlating findings, proofs, budget, and audit trail.
top_providerNoPrimary provider for cost comparison.
estimated_tokensNo
task_descriptionNoTask description for cost estimation.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNo
comparisonsNo
suggestionsNo
Behavior5/5

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

Description aligns with annotations (readOnlyHint, idempotentHint) and adds behavioral details about modes and that no budget records are written.

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?

Description is well-structured and front-loaded with purpose, but could be slightly more concise while remaining clear.

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 many siblings and moderate complexity, description fully covers both modes, parameters, sibling differentiation, and ties to ck_budget; output schema exists supplementing return info.

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%; description adds context for mode-specific parameters (session_id for suggest; task_description, estimated_tokens, top_provider, top_model for compare) beyond schema definitions.

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?

Description clearly states the tool provides cost optimization or price comparison, distinguishes two modes, and differentiates from sibling ck_budget by specifying 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 suggest vs compare mode, which parameters to pass for each, and advises using ck_budget for recording spend.

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