Read/write tools over a local, fetch-once knowledge base. Provides full-text search, document retrieval, and archival of reports, articles, and news with metadata management.
Six tools with complete input schemas and descriptions. Naming follows verb_noun pattern (kb_search, kb_get_doc, kb_save_*). Descriptions are detailed (150-300 chars) and explain WHEN to use each tool. However, output schemas are not formally documented, responses are plain text rather than structured JSON. Parameters lack enum constraints (e.g., doc_type accepts free-form strings instead of a closed set). Error handling is minimal; no recovery guidance for common failures (e.g., 'doc_id does not exist' returns a bare message with no next steps). Security is reasonable (no secrets in params, read-only tools marked), but no permission gates or audit trail declarations.
Cheap pre-fetch dedup check (rule R1): exact external_id, or fuzzy title (+doc_date narrows it). Returns whether the library already has the document, plus up to 3 candidates.
Fetch one knowledge-base document by id: metadata + body. Use after a kb_search hit. The body is truncated to max_chars (default 6000, max 400000); the return states the full length so you can re-call with a larger max_chars when needed. ocr_required documents have no usable body — the return says so; cite metadata only, never pretend you read the body.
Archive a local file (typically a downloaded PDF) into the library. The file is COPIED into data/files/ — the original is kept, never deleted (R9). PDFs are auto-extracted with pypdf; scanned PDFs that yield no text are flagged ocr_required instead of silently stored as empty. Duplicate (same external_id or sha256) returns existing_id.
Save a fetched document's full text into the knowledge base. Call this in the SAME session you fetched it. title/content required. external_id is the source system's document id (any string, e.g. "acme:12345") — pass it whenever the source has one; it is the primary dedup key. Every other field must come VERBATIM from the fetched document; leave blank what the source doesn't say, never invent (R4). Returns {"status":"duplicate","existing_id":N} when the external_id already exists — that is NOT an error; report it as already-in-library.
Output schemas not formally documented. Tools return plain text (kb_search, kb_get_doc) or JSON strings (kb_save_report, kb_save_file) without declaring expected fields, types, or structure. LLMs cannot reliably parse responses or plan downstream calls.
Parameters accept free-form strings where enums are appropriate. doc_type, source, and file_mode accept arbitrary values instead of a closed set (announcement|research_report|minutes|article|prospectus|training|other). LLMs hallucinate invalid values.
Error handling lacks recovery guidance. 'doc_id does not exist' and 'No match in the library' return bare messages with no actionable next steps. LLMs cannot self-correct or plan alternatives.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | C | 64 | 2026-07-28+ | v2 |
Search the local knowledge base (reports/articles/news, full text). MUST be called before fetching any document from an external source. query: keywords, whitespace-separated (e.g. "storage systems battery"). Any word shorter than 3 characters (common in Chinese) falls back to fuzzy matching automatically. doc_type: optional filter (announcement/research_report/minutes/article/ prospectus/training/other). company: optional fuzzy filter. date_from/date_to: optional, YYYY-MM-DD. limit: default 8, max 30. Returns a compact list: [id] date type institution | title | xid=... plus an indented snippet per hit. On a hit, call kb_get_doc(id) — do NOT fetch the same document from an external source again.
Library statistics: totals, type/source breakdown, OCR backlog, size, latest additions.
kb_stats description is vague (18 chars: 'Library statistics...'). Does not explain what fields are returned or when to call it. Baseline for param descriptions is 72 chars; this falls far short.
No permission gates or scope declarations. Tools that write (kb_save_report, kb_save_file) do not declare required permissions (write:kb) or verify caller authority. No audit trail logging.