find_similar_errors
Identify programming errors similar to a given query by searching the Tribal Knowledge Service database, returning a list of relevant error records for troubleshooting and learning.
Instructions
Find errors similar to the given query.
Args:
query: Text to search for in the knowledge base
max_results: Maximum number of results to return
Returns:
List of similar error records
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| max_results | No | ||
| query | Yes |
Implementation Reference
- Handler function that executes the find_similar_errors tool by making an API request to find similar errors.@mcp.tool() async def find_similar_errors(query: str, max_results: int = 5) -> List[Dict]: """ Find errors similar to the given query. Args: query: Text to search for in the knowledge base max_results: Maximum number of results to return Returns: List of similar error records """ params = {"query": query, "max_results": max_results} return await make_api_request("GET", "/api/v1/errors/similar/", params=params)
- src/mcp_server_tribal/mcp_app.py:148-162 (handler)Handler function that executes the find_similar_errors tool using ChromaStorage to search for similar errors.@mcp.tool() async def find_similar_errors(query: str, max_results: int = 5) -> List[Dict]: """ Find errors similar to the given query. Args: query: Text to search for in the knowledge base max_results: Maximum number of results to return Returns: List of similar error records """ records = await storage.search_similar(query, max_results) return [json.loads(record.model_dump_json()) for record in records]
- src/mcp_server_tribal/mcp_server.py:229-230 (registration)Registration/dispatch logic in handle_execution for the find_similar_errors tool.elif tool_name == "find_similar_errors": return await find_similar_errors(**params)