Skip to main content
Glama

ck_cost_optimizer

Read-onlyIdempotent

Get cost optimization suggestions or compare AI provider/model prices for a task. Use it before selecting a model for expensive multi-agent work.

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.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
comparisonNo
modeNo
suggestionsNo
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, idempotentHint=true. The description adds context: 'Read-only — no budget records are written', confirming non-destructive behavior, and explains the two modes' different return behaviors (optimization tips vs price breakdown). This supplements annotations well, though could mention any logging or caching 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?

Description is a single paragraph but efficiently organized: purpose, read-only note, mode explanations with parameter requirements, and when-to-use guidance. Every sentence adds new information without redundancy.

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?

For a tool with two modes and 7 parameters, the description covers both modes, required parameters per mode, and distinguishes from the sibling ck_budget. Since an output schema exists, return format is not needed. The description is complete for an AI agent to select and invoke correctly.

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% (5 of 7 params described). The description adds meaning by linking parameters to modes: session_id for suggest; task_description, estimated_tokens, top_provider, top_model for compare. It clarifies that top_provider and top_model serve as baseline. Missing explanation for 'spending' parameter, but overall adds value beyond 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 does two things: get cost optimization suggestions or compare AI provider/model prices. It specifies the verb 'get' and the resources (suggestions, prices). It distinguishes from sibling ck_budget by saying 'use ck_budget to record actual spend', so no confusion.

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?

Explicit guidance on when to use: 'Use ck_cost_optimizer before choosing a model for expensive multi-agent work; use ck_budget to record and enforce spend limits.' Also provides mode-specific parameter requirements: for 'suggest' pass session_id, for 'compare' pass task_description, estimated_tokens, top_provider, top_model. Clear when-not guidance.

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