Skip to main content
Glama
devrev

DevRev MCP Server

Official
by devrev

create_work

Create new issues or tickets in DevRev to track and manage work items by specifying type, title, and assigned part.

Instructions

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

Input Schema

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

Implementation Reference

  • Handler logic for the 'create_work' tool within the handle_call_tool function. Validates input parameters, constructs payload, calls DevRev 'works.create' API via make_devrev_request, and returns success or error message.
    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()}"
            )
        ]
  • Input schema and registration of the 'create_work' tool in the list_tools handler, defining parameters, descriptions, and required fields.
    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 make authenticated POST requests to DevRev API endpoints.
    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?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool creates items but lacks details on permissions required, whether creation is idempotent, error handling, or what happens on success (e.g., returns a work ID). This is inadequate for a mutation tool with zero annotation coverage.

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 front-loaded with the core action and resource, making it easy to parse quickly.

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?

For a mutation tool with 5 parameters, 40% schema coverage, no annotations, and no output schema, the description is incomplete. It doesn't address behavioral aspects like permissions or outcomes, leaving significant gaps for an AI agent to use the tool effectively.

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 40% (only 'applies_to_part' and 'owned_by' have descriptions). The description adds no parameter semantics beyond the schema, failing to explain 'type' enum values, 'title' purpose, or 'body' content. With low coverage, it doesn't compensate, but the schema's enum and required fields provide some structure, keeping it at baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Create') and resource ('new work item (issue, ticket) in DevRev'), making the purpose unambiguous. It distinguishes from siblings like 'update_work' by specifying creation, but doesn't explicitly differentiate from 'list_works' or 'get_work' beyond the action verb.

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?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., authentication), when not to use it, or how it relates to siblings like 'update_work' for modifications or 'list_works' for viewing existing items.

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