Skip to main content
Glama

semantic_cache_embedding_lookup

Match user prompts against cached vector embeddings to retrieve similar answers within a strict cosine threshold, reducing LLM token usage.

Instructions

Vector similarity cache lookup matching incoming user prompts against cached answers within a strict cosine distance threshold to save LLM tokens. (0.035 USDC on Base L2)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
payloadYesInput parameters or JSON string payload for the tool execution
paymentSignatureNoBase L2 USDC micropayment signature or transaction hash for x402 settlement

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.1/5.0
Behavior3/5

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

With no annotations, the description carries the behavioral disclosure burden. It adds useful context about the strict cosine distance threshold and the 0.035 USDC cost, and 'lookup' implies non-mutating behavior. However, it does not state what happens on a cache miss, whether any side effects occur, or what the return payload 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.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single compact sentence that front-loads the core action and resource, then provides the matching criterion, purpose, and cost. Every element contributes useful information without repetition or filler.

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 is adequate for understanding the tool's purpose, but there is no output schema and no mention of return values, cache-miss behavior, or required payment flow beyond the inline cost note. These are meaningful gaps for an agent deciding whether and how to invoke the tool 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. The description adds meaning by signaling that the payload corresponds to an incoming user prompt for similarity matching, which goes beyond the generic 'Input parameters or JSON string payload' schema text. It does not detail exact JSON structure, but the semantic intent is clear.

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 ('lookup') and resource ('cached answers') and clearly differentiates this from sibling embedding tools like deduplicate_embeddings_cosine or vector_embedding_cosine_hnsw_indexer by framing it as a cache read. The 'matching incoming user prompts' phrasing makes the exact 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 gives a clear use context: retrieving cached answers for incoming prompts to save LLM tokens. It does not explicitly name alternatives or exclusions, but the intended scenario is specific enough that an agent can infer when to call it.

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

Deploy Server

Other Tools