Skip to main content
Glama

session_context_usage

Monitor how much of the model context window an active opencode chat session uses. Get context_used and context_percent values to trigger conditional instructions.

Instructions

reports how much of the model context window the current opencode chat session is using reads the last message token usage from the opencode database when session_id is omitted the most recently updated active session in the target project is used context_limit overrides the context limit resolved from the models.dev cache use the returned context_used and context_percent values in conditional instructions

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_idNo
context_limitNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It openly states that the tool reads the last message token usage from the opencode database, explains the fallback behavior when session_id is omitted, and discloses that context_limit overrides the models.dev cache value. This is substantial, honest behavioral detail beyond what the name alone implies.

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?

Every sentence earns its place. The description front-loads the core purpose, then adds parameter behavior, override semantics, and usage guidance in a compact, scannable structure. There is no redundant or filler language.

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?

The tool is moderately complex, has no annotations, and an output schema exists but is not shown in the description. The description still covers the operation's source, default behavior, override behavior, and the key returned fields, which is sufficient for correct invocation and interpretation.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must add meaning for both parameters. It does: session_id determines which session is used, with a clear default when omitted; context_limit overrides the resolved context limit. This fully compensates for the bare input schema and gives an agent enough to pass correct values.

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 opens with a specific verb and resource: 'reports how much of the model context window the current opencode chat session is using.' This clearly identifies the tool's function and is distinct from all listed siblings, which are unrelated utilities. The mention of reading token usage from the opencode database further pins down what the tool actually does.

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 gives clear practical context: session_id behavior when omitted, context_limit overriding the resolved limit, and guidance to use the returned context_used and context_percent values in conditional instructions. It does not explicitly name alternatives or when-not-to-use, but the tool's niche is obvious and no sibling provides a similar context-reporting capability.

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

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/maxwellaguiarsilva/project-mcp-tools'

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