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 )

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