Skip to main content
Glama
devrev

DevRev MCP Server

Official
by devrev

create_work

Generate and manage new work items (issues, tickets) in DevRev by specifying type, title, and applicable part, with optional assignments and details.

Instructions

Create a new work item (issue, ticket) in DevRev

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
applies_to_partYesThe DevRev ID of the part to which the work item applies
bodyNo
owned_byNoThe DevRev IDs of the users who are assigned to the work item
titleYes
typeYes

Implementation Reference

  • Handler implementation for the 'create_work' tool. Validates required arguments, constructs payload for DevRev 'works.create' API, handles response or error.
    elif name == "create_work": if not arguments: raise ValueError("Missing arguments") type = arguments.get("type") if not type: raise ValueError("Missing type parameter") title = arguments.get("title") if not title: raise ValueError("Missing title parameter") applies_to_part = arguments.get("applies_to_part") if not applies_to_part: raise ValueError("Missing applies_to_part parameter") body = arguments.get("body", "") owned_by = arguments.get("owned_by", []) response = make_devrev_request( "works.create", { "type": type, "title": title, "body": body, "applies_to_part": applies_to_part, "owned_by": owned_by } ) if response.status_code != 201: error_text = response.text return [ types.TextContent( type="text", text=f"Create object failed with status {response.status_code}: {error_text}" ) ] return [ types.TextContent( type="text", text=f"Object created successfully: {response.json()}" ) ]
  • JSON Schema defining the input parameters for the 'create_work' tool, including required fields and properties.
    inputSchema={ "type": "object", "properties": { "type": {"type": "string", "enum": ["issue", "ticket"]}, "title": {"type": "string"}, "body": {"type": "string"}, "applies_to_part": {"type": "string", "description": "The DevRev ID of the part to which the work item applies"}, "owned_by": {"type": "array", "items": {"type": "string"}, "description": "The DevRev IDs of the users who are assigned to the work item"} }, "required": ["type", "title", "applies_to_part"],
  • Registration of the 'create_work' tool in the list_tools() handler, specifying name, description, and input schema.
    types.Tool( name="create_work", description="Create a new work item (issue, ticket) in DevRev", inputSchema={ "type": "object", "properties": { "type": {"type": "string", "enum": ["issue", "ticket"]}, "title": {"type": "string"}, "body": {"type": "string"}, "applies_to_part": {"type": "string", "description": "The DevRev ID of the part to which the work item applies"}, "owned_by": {"type": "array", "items": {"type": "string"}, "description": "The DevRev IDs of the users who are assigned to the work item"} }, "required": ["type", "title", "applies_to_part"], }, ),
  • Utility function make_devrev_request used by the create_work handler to send POST requests to DevRev API, including authentication via DEVREV_API_KEY.
    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 )

Other Tools

Related 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