Production-grade prompt cache and semantic deduplicator using Jaccard token similarity to prevent redundant LLM invocations
Single tool with critical definition gaps. Tool name 'lookup_or_insert_cache' violates single-responsibility principle (combines lookup AND insert). Input schema present but parameters lack descriptions entirely. Tool description is 108 chars but vague about when to use it and what it returns. No output schema documented. Parameters 'query_prompt' and 'estimated_tokens' have type info but zero descriptions, LLM cannot infer intent. No error handling guidance. No pagination, no limits on cache size, no recovery paths.
Look up prompt in semantic cache via Jaccard similarity or insert new entry.
Tool name combines two actions (lookup AND insert). Violates single-responsibility principle. Should split into 'lookup_cache' and 'insert_cache' so agent can compose them independently.
Input parameters lack descriptions. 'query_prompt' and 'estimated_tokens' have types but no descriptions explaining what they control or expected format. LLM cannot infer parameter meaning from names alone.
No output schema documented. Response structure (cache_status, matched_key, jaccard_similarity, etc.) is inferred from code, not declared. LLM cannot plan downstream operations without knowing return fields.
No error handling or recovery guidance. Tool silently returns CACHE_MISS on any non-match; no guidance if similarity threshold is wrong, cache is corrupted, or tokens are miscalculated. No actionable error messages.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | F | 35 | 2026-07-28+ | v2 |
Tool description (108 chars) is vague. Does not explain WHEN to call it vs other cache tools, what 'Jaccard similarity' means to an LLM, or why estimated_tokens matters. Lacks actionable context for tool selection.