Skip to main content
Glama
kpsunil97

DevRev MCP Server

by kpsunil97

search

Search DevRev for articles, issues, or tickets using specific queries to find relevant information quickly.

Instructions

Search DevRev using the provided query

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
namespaceYes

Implementation Reference

  • Executes the 'search' tool: validates 'query' and 'namespace' arguments, calls DevRev API via make_devrev_request('search.hybrid'), handles errors, and returns search results as text.
    if 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 with the MCP server in list_tools(), providing name, description, and JSON schema for inputs (query: string, namespace: enum['article','issue','ticket']).
    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"]},
            },
            "required": ["query", "namespace"],
        },
    ),
  • JSON schema for 'search' tool inputs: object with required 'query' (string) and 'namespace' (enum: article, issue, ticket).
    inputSchema={
        "type": "object",
        "properties": {
            "query": {"type": "string"},
            "namespace": {"type": "string", "enum": ["article", "issue", "ticket"]},
        },
        "required": ["query", "namespace"],
    },
  • Helper utility to make authenticated POST requests to DevRev API endpoints like 'search.hybrid', used by the 'search' tool handler.
    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/internal/{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 full burden. It states the tool performs a search but doesn't disclose behavioral traits such as whether it's read-only, destructive, requires authentication, has rate limits, or what the output format might be. The description is minimal and lacks essential operational context.

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 a single, efficient sentence with zero waste. It's appropriately sized for a simple tool and front-loaded with the core action. Every word earns its place, making it highly concise and well-structured.

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 tool's complexity (2 parameters with 0% schema coverage, no annotations, no output schema), the description is incomplete. It doesn't explain parameter usage, behavioral aspects, or what to expect from results. For a search tool with structured inputs, more context is needed to be adequately helpful.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate. It mentions 'using the provided query' but doesn't explain the 'query' parameter's semantics or the 'namespace' parameter with its enum values (article, issue, ticket). The description adds minimal meaning beyond the bare schema.

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 action ('search') and target ('DevRev'), which provides a basic purpose. However, it's vague about what exactly is being searched (e.g., content, records, objects) and doesn't distinguish from the sibling tool 'get_object'. It avoids tautology by not just repeating the name/title.

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 like 'get_object'. It mentions 'using the provided query' but doesn't specify contexts, prerequisites, or exclusions. Usage is implied only through 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/kpsunil97/devrev-mcp-server'

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