Skip to main content
Glama

Estimate Injection Tokens

vault_estimate_tokens
Read-onlyIdempotent

Estimate token counts for up to 500 documents in a vault before injection, helping you set the max_tokens limit accurately.

Instructions

Preview the token count of a vault injection without injecting documents.

Returns estimated token counts for each document (up to 500) so you can choose an appropriate max_tokens value before calling vault_inject. Uses tiktoken if available; falls back to char-based estimation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNo
vault_nameYes
max_single_doc_tokensNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

Annotations already declare readOnlyHint=true and idempotentHint=true, and the description reinforces no side effects by saying 'without injecting documents'. It adds useful behavioral details such as the 500-document limit and the estimation approach (tiktoken with fallback to char-based), which go beyond the annotations.

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 consists of two sentences, front-loaded with the main purpose, and contains no redundant phrases. It efficiently communicates the core function and key limitations without unnecessary detail.

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?

The description provides a clear overall purpose and mentions the 500-document limit and return of per-document token counts, but leaves parameter semantics entirely unexplained. With an output schema present, return values are partially covered, yet the lack of parameter context makes the tool not fully self-contained for a new agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, and the description fails to explain the three parameters. It mentions 'max_tokens' as an output use case, but the actual parameter is 'max_single_doc_tokens', and there is no explanation for 'vault_name' or 'query'. This is a significant gap for parameter understanding.

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 begins with a specific verb 'Preview' and resource 'token count of a vault injection', clearly distinguishing it from the injection operation. It also states 'without injecting documents' to differentiate from the actual injection tool, and mentions the 500-document limit, 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 Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly states the tool is used 'before calling vault_inject' to choose an appropriate max_tokens value, providing clear context for when to use it. It does not list exclusions or alternatives, but the reference to vault_inject serves as a direct sibling comparison.

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/labyrinth-analytics/loredocs'

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