Skip to main content
Glama

Estimate my prompt

estimate_my_prompt
Read-onlyIdempotent

Estimate whether prompt tokens fit model context, answer headroom, VRAM residency, and cache reuse before sending. Use when prompt grows or before changing context or model.

Instructions

Before sending a prompt: does a prompt of N tokens fit the context the model is loaded with, how much headroom is left for the answer, does the model sit in video memory, and how much of the prompt the cache would reuse, from this client's last turn on that model. Use it when a prompt grows, before raising num_ctx, or before switching model. For what is installed use list_local_models; for what actually happened use read_my_last_turn. model: a pulled model name, "gemma4" or "gemma4:latest"; unknown names get the list of pulled ones. prompt_tokens: 1 to 2000000, your estimate of the prompt size. client: your X-LLMxRay-Client name, so the cache estimate uses your own last turn. Needs Ollama reachable; the cache line needs LLMxRay running (npx llmxray). Under a second. No model is loaded or called.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelYesA pulled model name, with or without the tag.
clientNoSubstring of the client label, for the cache estimate. Omit for the last caller.
prompt_tokensYesSize of the prompt you intend to send, in tokens, 1 to 2000000.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.8.6

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, but the description adds prerequisites (Ollama reachable, LLMxRay running for the cache line), a latency bound (under a second), and an explicit side-effect disclaimer (no model is loaded or called). These are meaningful operational facts the agent cannot derive from annotations.

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?

Front-loaded with the purpose, then usage, then parameters, then prerequisites. Dense and every clause carries information, though the opening sentence is a long run-on of four questions that could be tightened.

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?

With no output schema, the description still conveys what the result covers (fit, headroom, VRAM, cache reuse), all three parameters, prerequisites, and cost. An agent has everything needed to call it 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 100%, so the baseline is 3, but the description adds real semantics beyond the schema: unknown model names return the list of pulled models, prompt_tokens is the caller's own estimate, and client ties the cache estimate to that client's last turn. This goes beyond restating the 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?

States a specific verb (estimate) and resource (my prompt) and enumerates exactly what is estimated: context fit for N tokens, answer headroom, VRAM residency, and cache reuse. It is clearly distinguishable from siblings like list_local_models and read_my_last_turn.

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 triggers are given ('when a prompt grows, before raising num_ctx, or before switching model') plus named alternatives with selection conditions: list_local_models for what is installed, read_my_last_turn for what actually happened. Nothing is left to inference.

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