002_agent_query-tools

A development task for improving document search and adding a query_docs MCP tool. It supports filters and can use SQLite’s built-in full-text search, with optional semantic search when available.

In plain words
What is it for?
Use it to search documents by path, plan, or tags; expose those searches through MCP; and combine semantic results with full-text results when requested.
Why use it?
It keeps document queries working even without an AI-based semantic search system, while allowing more relevant results when one is available.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/paulbreuler/limps/002_agent_query-tools
Clone the repo
git clone --depth 1 https://github.com/paulbreuler/limps
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 664 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00664
Opus 5 $0.00000 $0.00332
Sonnet 5 $0.00000 $0.00133
Haiku 4.5 $0.00000 $0.00066

Measured 2d ago against content hash 48f717cfc904, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

002_agent_query-tools scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plans/0041-limps-improvements/agents/002_agent_query-tools.agent.md · 97 lines

How it starts

The opening of the file, as written. The whole thing — 97 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Agent 2: Query Improvements

Plan Location: plans/0041-limps-improvements/0041-limps-improvements-plan.md

Scope

Features: #4 Own: packages/limps/src/tools/search-docs.ts, packages/limps/src/tools/query-docs.ts, packages/limps/src/tools/index.ts Depend on: none (semantic integration is optional, FTS5 fallback is default) Block: Agent 3 needs query tool documented

Interfaces

Export

  • search_docs filters (path/plan/tags)
  • query_docs MCP tool (works with or without semantic)

Receive

  • semantic_search output (optional, when available)

Features

#4: Query Improvements + query_docs

TL;DR: Add scoped filters and query_docs wrapper. Works independently of semantic search. Status: GAP Test IDs: search-docs-path-filter, query-docs-fts-fallback, query-docs-semantic-blend Files: packages/limps/src/tools/search-docs.ts, packages/limps/src/tools/query-docs.ts

Key Design Decision: This agent has no dependencies because query_docs must work without semantic search. The semantic integration is additive — when semantic is available and preferSemantic: true, blend results. Otherwise, use FTS5 only.

Fallback Behavior:

  1. If semantic disabled → FTS5 only
  2. If semantic enabled but Ollama unavailable → FTS5 only with warning
  3. If semantic enabled and available → blend FTS5 + semantic based on preferSemantic flag

TDD:

  1. search-docs-path-filter → impl path/plan/tag filters → refactor
  2. query-docs-fts-fallback → impl FTS5-only mode (no semantic deps) → refactor
  3. query-docs-semantic-blend → impl blended results when semantic available → refactor

Done

  • Path/plan/tag filters on search_docs
  • query_docs works without semantic (FTS5 only)
  • query_docs blends semantic when available
  • Clear fallback messaging in responses

Plan:

Depends on: No dependencies found

Blocks:

Read the full file on GitHub · 97 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 97 lines · 0 tokens per session scan A 48f717cfc904

Subscribe to this mod's changes

002_agent_query-tools is an agent published in the GitHub repository paulbreuler/limps (10 stars, last pushed 6mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 664 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.