Corpus-KB
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Capabilities
Features and capabilities supported by this server
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| ingest_fileC | Ingest a single file. Auto-detects code/markdown/text. |
| ingest_textB | Ingest raw text with optional type hint (code/markdown/text). |
| ingest_directoryC | Ingest all supported files in a directory. Supports all extensions in CodeChunker.LANGUAGE_MAP plus .md, .rst, .txt. |
| list_documentsB | List all ingested documents with their metadata. |
| delete_documentC | Delete an ingested document by its doc_id. |
| searchA | Hybrid search (vector + full-text + RRF) across all chunks. Args: query: Natural language query. k: Number of results (max 50). source_type: Optional filter: "code", "markdown", or "text". Returns: List of search results with text, source, score, and metadata. |
| search_contextA | Search with parent/sibling/child context expansion. For each result, includes surrounding chunks (context_chunks before and after) so the LLM has full context. Args: query: Natural language query. k: Number of primary results (max 20). context_chunks: Number of adjacent chunks to include (0-5). source_type: Optional filter: "code", "markdown", or "text". Returns: List of results, each with a "context" field containing surrounding chunks. |
| search_similarA | Find chunks similar to a given chunk by ID. Args: chunk_id: ID of the source chunk. k: Number of similar results to return (max 20). Returns: List of similar chunks with scores and text snippets. |
| retrieve_contextB | Search and return results formatted for LLM context building. Args: query: Natural language query. k: Number of results (max 20). filters: Optional JSON string of filter conditions. Returns: Formatted string with source citations. |
| add_entityA | Add an entity to the knowledge graph. Args: name: Entity name (e.g., "MyClass", "Authentication", "Paris"). type: Entity type (class, function, concept, person, place, etc.). metadata: Optional metadata dict. Returns: Created entity details including entity_id. |
| add_relationA | Add a directed relation between two entities. Args: source_id: Source entity ID. target_id: Target entity ID. rel_type: Type of relation (CALLS, DEPENDS_ON, CONTAINS, etc.). weight: Relation strength (0.0 to 1.0). Returns: Created relation details. |
| search_graphA | Search entities in the knowledge graph by name or type. Args: query: Search term for entity name. type: Optional entity type filter. limit: Max results (max 100). Returns: List of matching entities. |
| bfsC | BFS traversal from a starting entity. Args: start_entity_id: Entity ID to start from. max_depth: Max traversal depth (1-10). Returns: List of (entity_id, name, type, depth) entries. |
| get_entity_relationsC | Get all relations for an entity (incoming and outgoing). Args: entity_id: Entity ID. Returns: List of relations with source/target info. |
| sql_queryA | Run a SQL SELECT query over relational tables. Full SQL supported: SELECT, JOIN, CTE, GROUP BY, window functions, subqueries, UNION, etc. Available tables:
Examples: SELECT source_type, COUNT(*) as cnt FROM documents GROUP BY source_type SELECT * FROM chunks WHERE source_type = 'code' LIMIT 10 SELECT d.source, COUNT(c.chunk_id) as chunks FROM documents d JOIN chunks c ON d.doc_id = c.doc_id GROUP BY d.source ORDER BY chunks DESC SELECT d.source FROM documents d JOIN document_tags dt ON d.doc_id = dt.doc_id JOIN tags t ON dt.tag_id = t.tag_id WHERE t.name = 'important' Args: query: SQL SELECT query string. limit: Max rows to return (default 100, max 5000). Returns: Dict with "columns", "rows", and "row_count". |
| sql_executeA | Execute a write SQL statement (INSERT, UPDATE, DELETE) with safety rails. Safety rules enforced by the engine:
Use parameterized ? placeholders for values to prevent injection. For SELECT queries, use sql_query instead. Examples: INSERT INTO tags (name, color) VALUES ('urgent', 'red') UPDATE documents SET source_type = 'markdown' WHERE doc_id = 'abc-123' DELETE FROM document_tags WHERE doc_id = 'abc-123' INSERT INTO metadata (key, value, doc_id) VALUES ('reviewer', 'alice', 'abc-123') Args: statement: SQL write statement (INSERT, UPDATE, DELETE). Returns: Dict with "affected_rows" count, or "error" if blocked. |
| sql_tablesA | List all available relational tables with their schema. Returns table name, column name, column type, and nullability for each column in every user table. |
| add_tagC | Create a new tag for categorizing documents. |
| tag_documentB | Apply a tag to a document. Creates the tag if it doesn't exist. |
| untag_documentC | Remove a tag from a document. |
| get_document_tagsA | Get all tags applied to a document. |
| set_metadataA | Set a metadata key-value pair, optionally scoped to a document. Overwrites any existing value for the same key+doc_id combination. |
| get_metadataA | Retrieve metadata entries, optionally filtered by key and/or doc_id. Omit both to get all metadata. Filter by key to find all values for a key. Filter by doc_id to find all metadata for a document. |
| sync_databaseA | Sync data from LanceDB vector store into relational tables. Call this after ingesting documents to make relational queries up to date. The sync is idempotent — call it anytime. |
| query_document_statsB | Get aggregate statistics about the document corpus via SQL. Returns: total documents, total chunks, docs by type, chunks by type, average chunks per document, date range. |
| list_versionsA | List all versions of the chunks table for time-travel. Returns: List of version entries with version number, timestamp, and tag. |
| create_tagB | Tag a specific version for reference. Args: version: Version number to tag. tag_name: Human-readable tag name (e.g., "v1.0", "before-refactor"). Returns: Confirmation with version and tag name. |
| get_statsC | Get database statistics. Returns: Stats object with counts and storage info. |
| checkout_versionC | Check out a specific table version for time-travel queries. |
| restore_versionC | Restore the table to a specific version. |
| create_branchC | Create a new branch from an optional version. |
| list_branchesA | List all branches. |
| switch_branchC | Switch to a specified branch. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| stats_summary | Database statistics. |
| versions_resource | Version tree. |
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/moliver28/corpus-kb'
If you have feedback or need assistance with the MCP directory API, please join our Discord server