Skip to main content
Glama
devrev

DevRev MCP Server

Official
by devrev

search

Search DevRev for articles, issues, tickets, parts, users, accounts, organizations, vistae, or incidents using a specific query to find relevant information quickly.

Instructions

Search DevRev using the provided query

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
namespaceYesThe namespace to search in. Use this to specify the type of object to search for.

Implementation Reference

  • The handler function that executes the 'search' tool logic. It validates input arguments, calls the DevRev API endpoint 'search.hybrid' using make_devrev_request, handles errors, and returns the search results as text content.
    elif name == "search":
        if not arguments:
            raise ValueError("Missing arguments")
    
        query = arguments.get("query")
        if not query:
            raise ValueError("Missing query parameter")
        
        namespace = arguments.get("namespace")
        if not namespace:
            raise ValueError("Missing namespace parameter")
    
        response = make_devrev_request(
            "search.hybrid",
            {
                "query": query, 
                "namespace": namespace
            }
        )
        if response.status_code != 200:
            error_text = response.text
            return [
                types.TextContent(
                    type="text",
                    text=f"Search failed with status {response.status_code}: {error_text}"
                )
            ]
        
        search_results = response.json()
        return [
            types.TextContent(
                type="text",
                text=f"Search results for '{query}':\n{search_results}"
            )
        ]
  • Registers the 'search' tool in the list_tools handler by including it in the returned list of tools, specifying its name, description, and input schema.
    types.Tool(
        name="search",
        description="Search DevRev using the provided query",
        inputSchema={
            "type": "object",
            "properties": {
                "query": {"type": "string"},
                "namespace": {
                    "type": "string", 
                    "enum": ["article", "issue", "ticket", "part", "dev_user", "account", "rev_org", "vista", "incident"],
                    "description": "The namespace to search in. Use this to specify the type of object to search for."
                },
            },
            "required": ["query", "namespace"],
        },
    ),
  • Helper utility function used by the 'search' handler to make authenticated POST requests to DevRev API endpoints, specifically 'search.hybrid' as documented.
    def make_devrev_request(endpoint: str, payload: Dict[str, Any]) -> requests.Response:
        """
        Make an authenticated request to the DevRev API.
        
        Args:
            endpoint: The API endpoint path (e.g., "works.get" or "search.hybrid")
            payload: The JSON payload to send
        
        Returns:
            requests.Response object
        
        Raises:
            ValueError: If DEVREV_API_KEY environment variable is not set
        """
        api_key = os.environ.get("DEVREV_API_KEY")
        if not api_key:
            raise ValueError("DEVREV_API_KEY environment variable is not set")
    
        headers = {
            "Authorization": f"{api_key}",
            "Content-Type": "application/json",
        }
        
        return requests.post(
            f"https://api.devrev.ai/{endpoint}",
            headers=headers,
            json=payload
        ) 
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool performs a search but does not describe any behavioral traits such as whether it's read-only, has rate limits, requires authentication, or what the output format might be. This is a significant gap for a tool with no structured behavioral hints.

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

Conciseness5/5

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

The description is extremely concise with a single sentence, 'Search DevRev using the provided query', which is front-loaded and wastes no words. Every part of the sentence contributes to the purpose, making it efficient and well-structured for its brevity.

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 search tool with 2 required parameters, no annotations, and no output schema, the description is incomplete. It does not explain what 'DevRev' is, how the search results are returned, or any constraints like pagination or error handling. This leaves the agent with insufficient context to use the tool effectively beyond basic parameter input.

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 50%, with one parameter ('namespace') having a description and enum values, while 'query' lacks a description. The tool description does not add any meaning beyond the schema, as it does not explain what 'query' should contain or how the search operates. Since schema coverage is moderate, the baseline score of 3 is applied, but the description fails to compensate for the undocumented 'query' parameter.

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 the tool's purpose as 'Search DevRev using the provided query', which includes a verb ('Search') and resource ('DevRev'), making it clear what the tool does. However, it lacks specificity about what 'DevRev' refers to (e.g., a platform or system) and does not distinguish it from sibling tools like 'list_parts' or 'list_works', which might also retrieve data. This makes it vague but not tautological.

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?

The description provides no guidance on when to use this tool versus alternatives. It does not mention sibling tools like 'list_parts' or 'list_works', nor does it specify contexts or exclusions for its use. This leaves the agent without explicit or implied usage instructions, relying solely on the tool name and parameters.

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/devrev/mcp-server'

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