Skip to main content
Glama

Estimate Roleplay Context Window Budget

estimate_roleplay_context
Read-onlyIdempotent

Estimate total context window usage across character settings, Memo, Lorebook entries, and multi-turn history to check fit for 8K–32K or custom token limits.

Instructions

Estimate total context window usage for a character setting, editable long-story Memo, constant/triggered Lorebook entries, and multi-turn conversation history across 8K/16K/24K/32K (or custom) context windows.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "estimate_roleplay_context"
  }
}

Input Schema

NameRequiredDescriptionDefault
memoTextNoEditable long-story Memo / summary notes text.
scenarioNoScene or scenario setup text.
descriptionNoCharacter description text.
personalityNoCharacter personality traits text.
firstMessageNoOpening greeting message.
historyTurnsNoNumber of conversation turns in history (default: 20).
systemPromptNoCustom system prompt text.
contextWindowsNoTarget context window sizes in tokens (default: [8192, 16384, 24576, 32768]).
lorebookEntriesNoLorebook / Worldbook entries with constant or triggered active state.
avgTokensPerTurnNoAverage tokens per turn (default: 220).
reservedOutputTokensNoTokens reserved for model output (default: 512).
postHistoryInstructionsNoPost-history instruction text.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, and openWorldHint=false, so the safety profile is fully covered by structured data. The description adds that estimation is performed across multiple window sizes, which is useful behavioral context, but it says nothing about how the estimate is computed, whether triggered (inactive) lorebook entries are counted, or what the result looks like.

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?

One dense sentence with no filler, and the core purpose is front-loaded. It could be marginally tighter — "editable long-story Memo" and the duplicated context-window list are slightly verbose — but nothing is wasted.

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?

With 12 optional parameters and no output schema, the description should describe the shape of the returned estimate (presumably a per-window usage breakdown) since nothing else does. It covers the inputs well and the safety profile comes from annotations, but the return-value gap leaves an agent guessing about what it will get back.

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

Parameters3/5

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

Schema description coverage is 100%, so every one of the 12 parameters is already documented, including defaults for historyTurns, avgTokensPerTurn, reservedOutputTokens, and contextWindows. The description restates the major input categories but adds no formatting, sizing, or interaction semantics beyond the schema, so the baseline of 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description gives a specific verb ("Estimate") and a precise resource ("total context window usage") and enumerates the contributing components: character setting, Memo, Lorebook entries, and conversation history. It is unmistakably a budget/estimation tool, not a validator or linter, so the sibling tools are unlikely to be confused with it, but there is no explicit differentiation statement.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

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

Usage is only implied: the agent can infer this is for checking whether a character card plus history fits in a context window. There is no statement of when to call this versus lint_character_prompt or validate_character_card, and no guidance on prerequisites or typical workflow ordering.

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