Skip to main content
Glama

Inject Vault Documents

vault_inject
Read-onlyIdempotent

Inject relevant vault documents into conversation context with token-budget enforcement. Documents are ranked by relevance and priority, then packed to fit within the cap.

Instructions

Load ranked vault documents into conversation context with token-budget enforcement.

Documents are ranked by FTS5 relevance (when query is provided) and priority weight, then packed greedily until the effective token cap is reached.

Args: vault_name: Vault name or ID. query: Optional FTS5 search query to rank documents by relevance. max_tokens: Hard token budget. Overrides vault DB cap. Effective cap = max_tokens * safety_factor. cap_behavior: 'best_effort' (inject as many docs as fit) or 'strict' (error if any doc exceeds cap). session_token: Optional opaque string used as per-session cache key. max_single_doc_tokens: Truncate individual documents to this many tokens. 0 = no per-doc limit. safety_factor: Fraction of max_tokens to use as effective cap (default 0.60 = 60%).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNo
max_tokensNo
vault_nameYes
cap_behaviorNobest_effort
safety_factorNo
session_tokenNo
max_single_doc_tokensNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

Despite annotations already declaring readOnly, idempotent, and non-destructive behavior, the description adds substantial details: ranking algorithm, greedy packing, effective cap calculation, cap_behavior modes, per-session caching, and per-doc truncation. These go well beyond 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 is well-structured: a crisp one-line summary, a concise explanatory paragraph, and a clear Args list. Every sentence carries meaningful information with no redundancy or filler.

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?

For a tool with 7 parameters and complex ranking/budget behavior, the description covers all key aspects: selection criteria, token budget enforcement, caching, and truncation. The presence of an output schema obviates the need to describe return values, so the description is complete for its complexity.

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?

The schema itself has no descriptions (0% coverage), but the description's Args block fully explains every parameter, including max_tokens overriding vault DB cap, safety_factor's default and effect, cap_behavior's two modalities, session_token as a cache key, and max_single_doc_tokens truncation semantics.

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 states a specific verb ('Load ranked vault documents') and resource ('into conversation context') with a clear purpose ('token-budget enforcement'). It distinguishes from siblings like vault_inject_by_tag and vault_inject_summary by emphasizing ranking by FTS5 relevance and priority.

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 provides clear context for when to use the tool (when ranked injection with token budgeting is needed) but does not explicitly mention alternatives or exclusion scenarios. It implies use cases but lacks direct 'use this instead of X' guidance.

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