Skip to main content
Glama
agentience

Tribal Knowledge Service

by agentience

find_similar_errors

Search the Tribal Knowledge Service for programming errors similar to your query to identify patterns and solutions from past incidents.

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
NameRequiredDescriptionDefault
queryYes
max_resultsNo

Implementation Reference

  • MCP tool handler for 'find_similar_errors' that delegates to ChromaStorage similarity search.
    @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]
  • Core implementation of similarity search using ChromaDB's vector query on error record documents.
    async def search_similar(
        self, text_query: str, max_results: int = 5
    ) -> List[ErrorRecord]:
        """Search for error records with similar text content."""
        results = self.collection.query(
            query_texts=[text_query],
            n_results=max_results,
            include=["documents", "distances"],
        )
    
        # Convert results to ErrorRecord objects
        error_records = []
        if results.get("documents") and results["documents"][0]:
            for doc_str in results["documents"][0]:
                document = json.loads(doc_str)
                error_records.append(self._document_to_error(document))
    
        return error_records
  • Alternative MCP tool handler that proxies requests to the Tribal API endpoint.
    @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)
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It mentions returning a list of similar error records but doesn't disclose behavioral traits such as how similarity is determined, whether it's read-only, performance characteristics, or error handling. This is a significant gap for a search tool with zero annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded with the core purpose. The Args and Returns sections are structured clearly, though the 'Returns' part could be more specific. Every sentence adds value, but it could be slightly more concise by integrating the sections more fluidly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a similarity search tool with no annotations, no output schema, and low schema coverage, the description is incomplete. It doesn't explain what 'similar' means, the return format beyond 'List of similar error records', or how results are ordered, leaving gaps for the agent to infer behavior.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the schema provides no parameter descriptions. The description adds basic semantics for 'query' ('Text to search for in the knowledge base') and 'max_results' ('Maximum number of results to return'), which compensates partially but lacks details like format constraints or default behavior beyond the schema's default value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states 'Find errors similar to the given query' which provides a clear verb ('Find') and resource ('errors'), but it's vague about what constitutes 'similar' and doesn't distinguish from sibling tools like 'search_errors'. It's not tautological but lacks specificity about the similarity mechanism.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'search_errors' or 'get_error_by_id'. The description implies usage for finding similar errors but doesn't specify contexts, prerequisites, or exclusions, leaving the agent to guess based on tool names alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

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/agentience/tribal_mcp_server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server