Detailed documentation for all 8 MCP tools exposed by th0th. Each tool includes parameter schemas, usage examples, and response formats.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/S1LV4/th0th/llms.txt
Use this file to discover all available pages before exploring further.
th0th_index
Index a project directory for semantic search with embeddings.Indexing runs asynchronously in the background. Use
th0th_index_status to check progress.Parameters
Absolute path to the project directory to index
Unique identifier for the project (defaults to directory name)
Force reindex even if project already exists
Pre-cache common queries after indexing for faster initial searches
Custom queries to pre-cache (uses defaults if not provided)
Response
Job ID for tracking indexing progress
Project identifier
Path to the indexed project
Current status:
started, running, completed, or failedStatus message with instructions
Example usage
th0th_index_status
Get the status and progress of a background indexing job. Use this after callingth0th_index to check if indexing has completed.
Parameters
Job ID returned from
th0th_indexResponse
Job ID being tracked
Current job status:
running, completed, or failedProgress information (files processed, completion percentage)
Project identifier
Error message if status is
failedExample usage
th0th_search
Search for code using semantic and keyword search with RRF (Reciprocal Rank Fusion) ranking.Parameters
Search query (natural language or keywords)
Project ID to search in
Project path (required for autoReindex)
Maximum number of results to return
Minimum relevance score (0-1)
Response format:
summary (preview only, saves 70% tokens) or full (includes content)Automatically reindex if project index is stale (can increase latency)
Glob patterns to include (e.g.,
['src/components/**/*.tsx', 'src/utils/**'])Glob patterns to exclude (e.g.,
['**/*.test.*', '**/*.spec.*'])Include detailed score breakdown (vector, keyword, RRF components)
Response
Array of search results with file paths, content, and scores
Original search query
Total number of results found
Whether results were served from cache
Example usage
th0th_remember
Store information in the hierarchical memory system backed by SQLite.Parameters
Content to store
Type of memory:
preference, conversation, code, decision, or patternUser ID for filtering memories
Project ID for project-specific memories
Session ID for session-specific memories
Agent ID (e.g.,
orchestrator, implementer, architect, optimizer)Tags for categorization
Importance score (0-1)
Output format:
json or toonResponse
Unique memory ID
Stored content
Memory type
Timestamp when memory was created
Example usage
th0th_recall
Search stored memories across sessions using semantic search.Parameters
Search query (what to remember)
Filter by user ID
Filter by project ID
Filter by session ID
Filter by agent ID (
orchestrator, implementer, architect, optimizer)Filter by memory types:
['preference', 'conversation', 'code', 'decision', 'pattern']Maximum results to return
Minimum importance (0-1)
Include persistent memories from other sessions
Output format:
json or toonResponse
Array of matching memories with content, type, score, and metadata
Original search query
Total number of memories found
Example usage
th0th_compress
Compress context using semantic compression strategies.Compression is rule-based and deterministic. It keeps structure while removing details, achieving 70-98% token reduction.
Parameters
Content to compress
Compression strategy:
code_structure, conversation_summary, semantic_dedup, or hierarchicalTarget compression ratio (0-1, e.g., 0.7 = 70% reduction)
Programming language (for code compression)
Response
Compressed content
Original content length in characters
Compressed content length in characters
Original token count
Compressed token count
Number of tokens saved
Actual compression ratio achieved
Example usage
- Code Structure
- Conversation Summary
- Semantic Dedup
th0th_optimized_context
Retrieve and compress context with maximum token efficiency. Combines search + compression in one call.This is the most powerful tool for AI context management. It searches, compresses, and optimizes token usage automatically.
Parameters
Search query to find relevant context
Project ID for code context
Project path (for auto-reindex)
Maximum tokens in returned context
Maximum search results to include
Response
Optimized context (compressed and formatted)
Array of source files included
Number of search results included
Number of memories included
Tokens saved by compression
Compression ratio achieved
Example usage
Workflow
- Search: Semantic + keyword search for relevant code
- Compress: Apply code_structure compression
- Optimize: Fit results within maxTokens budget
- Return: Formatted context with metadata
th0th_analytics
Get usage patterns, cache performance, and search metrics.Parameters
Analytics type:
summary, project, query, cache, or recentProject ID (required for
type='project' or type='cache')Search query (required for
type='query')Limit for results (default: 10 for most, 50 for recent)
Response
Response varies by analytics type:- Summary
- Project
- Cache
- Recent
Example usage
Response Formats
JSON format
Standard JSON response:TOON format
Tree Object Oriented Notation (70% smaller than JSON):TOON format is more readable and uses significantly fewer tokens. Set
format: "toon" in memory tools to enable it.Error handling
All tools return a consistent error format:- Project not indexed: Run
th0th_indexfirst - Invalid projectId: Check that the project exists
- Missing required parameter: Check tool schema
- API not reachable: Ensure th0th API is running on port 3333
Performance tips
Use summary mode
Set
responseMode: "summary" in th0th_search to save 70% tokensEnable cache warmup
Set
warmCache: true in th0th_index for faster initial searchesLeverage optimized context
Use
th0th_optimized_context instead of separate search + compress callsFilter with glob patterns
Use
include and exclude patterns to narrow search scopeNext steps
MCP Overview
Learn about MCP integration and setup
REST API
Use th0th via HTTP instead of MCP