Skip to main content
Glama
kpsunil97

DevRev MCP Server

by kpsunil97

get_object

Retrieve comprehensive details about any DevRev object by providing its unique identifier. Use this tool to access object information from the DevRev platform through the MCP server.

Instructions

Get all information about a DevRev object using its ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes

Implementation Reference

  • Handler logic for executing the 'get_object' tool. It extracts the object ID from arguments, calls the DevRev 'works.get' API endpoint, handles HTTP errors, and returns the object details as text content.
    elif name == "get_object": if not arguments: raise ValueError("Missing arguments") id = arguments.get("id") if not id: raise ValueError("Missing id parameter") response = make_devrev_request( "works.get", {"id": id} ) if response.status_code != 200: error_text = response.text return [ types.TextContent( type="text", text=f"Get object failed with status {response.status_code}: {error_text}" ) ] object_info = response.json() return [ types.TextContent( type="text", text=f"Object information for '{id}':\n{object_info}" ) ]
  • Tool registration in the list_tools handler, defining the name, description, and input schema (requiring 'id' as string).
    types.Tool( name="get_object", description="Get all information about a DevRev object using its ID", inputSchema={ "type": "object", "properties": { "id": {"type": "string"}, }, "required": ["id"], }, )
  • Utility function to perform authenticated POST requests to DevRev API endpoints, used by the get_object handler to fetch object details.
    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