Skip to main content
Glama

ck_cost_optimizer

Read-onlyIdempotent

Get cost optimization tips based on recent spending patterns or compare AI provider/model prices for a task. Use suggest mode for insights, or compare mode for a side-by-side breakdown before selecting models.

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
Behavior4/5

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

Annotations declare readOnlyHint=true, idempotentHint=true, destructiveHint=false. The description confirms 'Read-only — no budget records are written' and outlines two modes with their outputs (suggest: optimization tips; compare: price breakdown). This adds value beyond annotations without contradicting them.

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 three sentences: purpose and read-only status, mode definitions, and usage guidance with an alternative. It is front-loaded, efficient, and every sentence adds actionable value without redundancy.

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?

Given 7 parameters and an output schema, the description covers the core logic (two modes, parameter requirements, return types) and provides a real-world usage scenario. While it omits the 'spending' parameter, the overall completeness is high for the tool's complexity.

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?

With 71% schema description coverage, the description clarifies the critical parameter 'mode' and maps other parameters to modes (e.g., session_id for suggest; task_description, estimated_tokens, top_provider, top_model for compare). However, the 'spending' parameter is not mentioned, leaving a small gap.

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 function: 'Get cost optimization suggestions or compare AI provider/model prices for a task.' It specifies two distinct modes (suggest, compare) and contrasts with sibling tool ck_budget for recording spend, making the purpose unambiguous.

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 usage guidance is provided: 'Use ck_cost_optimizer before choosing a model for expensive multi-agent work; use ck_budget to record and enforce spend limits.' The description details which parameters to pass for each mode (session_id for suggest, task_description/estimated_tokens/top_provider/top_model for compare), offering clear when-to-use and when-not-to-use information.

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