Skip to main content
Glama
devrev

DevRev MCP Server

Official
by devrev

create_part

Generate a new enhancement part in DevRev by specifying type, name, owners, parent parts, and description using the MCP server.

Instructions

Create a new part (enhancement) in DevRev

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
descriptionNoThe description of the part
nameYes
owned_byYesThe DevRev IDs of the users assigned to the part
parent_partYesThe DevRev IDs of the parent parts
typeYes

Implementation Reference

  • Handler implementation for the 'create_part' tool. Validates input arguments, builds the payload, makes a POST request to DevRev API endpoint 'parts.create', and returns success or error message.
    elif name == "create_part": if not arguments: raise ValueError("Missing arguments") payload = {} type = arguments.get("type") if not type: raise ValueError("Missing type parameter") payload["type"] = type part_name = arguments.get("name") if not part_name: raise ValueError("Missing name parameter") payload["name"] = part_name owned_by = arguments.get("owned_by") if not owned_by: raise ValueError("Missing owned_by parameter") payload["owned_by"] = owned_by parent_part = arguments.get("parent_part") if not parent_part: raise ValueError("Missing parent_part parameter") payload["parent_part"] = parent_part description = arguments.get("description") if description: payload["description"] = description response = make_devrev_request( "parts.create", payload ) if response.status_code != 201: error_text = response.text return [ types.TextContent( type="text", text=f"Create part failed with status {response.status_code}: {error_text}" ) ] return [ types.TextContent( type="text", text=f"Part created successfully: {response.json()}" ) ]
  • JSON Schema definition for the 'create_part' tool inputs, including required fields: type (enhancement), name, owned_by, parent_part.
    types.Tool( name="create_part", description="Create a new part (enhancement) in DevRev", inputSchema={ "type": "object", "properties": { "type": {"type": "string", "enum": ["enhancement"]}, "name": {"type": "string"}, "owned_by": {"type": "array", "items": {"type": "string"}, "description": "The DevRev IDs of the users assigned to the part"}, "parent_part": {"type": "array", "items": {"type": "string"}, "description": "The DevRev IDs of the parent parts"}, "description": {"type": "string", "description": "The description of the part"}, }, "required": ["type", "name", "owned_by", "parent_part"], }, ),
  • Tool registration via the @server.list_tools() decorator, which returns a list of all available tools including 'create_part'.
    @server.list_tools() async def handle_list_tools() -> list[types.Tool]: """ List available tools. Each tool specifies its arguments using JSON Schema validation. """ return [ types.Tool( name="get_current_user", description="Fetch the current DevRev user details. When the user specifies 'me' in the query, this tool should be called to get the user details.", inputSchema={"type": "object", "properties": {}}, ), types.Tool( name="get_vista", description="Retrieve information about a vista in DevRev using its ID. In DevRev a vista is a sprint board which contains sprints (or vista group items). The reponse of this tool will contain the sprint (or vista group item) IDs that you can use to filter on sprints.", inputSchema={ "type": "object", "properties": { "id": { "type": "string", "description": "The DevRev ID of the vista" } }, "required": ["id"] }, ), 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", "part", "dev_user", "account", "rev_org", "vista", "incident"], "description": "The namespace to search in. Use this to specify the type of object to search for." }, }, "required": ["query", "namespace"], }, ), types.Tool( name="get_work", description="Get all information about a DevRev work item (issue, ticket) using its ID", inputSchema={ "type": "object", "properties": { "id": {"type": "string", "description": "The DevRev ID of the work item"}, }, "required": ["id"], }, ), 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"], }, ), types.Tool( name="update_work", description="Update an existing work item (issue, ticket) in DevRev", inputSchema={ "type": "object", "properties": { "type": {"type": "string", "enum": ["issue", "ticket"]}, "id": {"type": "string"}, "title": {"type": "string"}, "body": {"type": "string"}, "applies_to_part": {"type": "string", "description": "The DevRev ID of the part to which the work item applies"}, "modified_by": {"type": "array", "items": {"type": "string"}, "description": "The DevRev IDs of the users who modified the work item"}, "owned_by": {"type": "array", "items": {"type": "string"}, "description": "The DevRev IDs of the users who are assigned to the work item"}, "stage": {"type": "string", "description": "The stage name of the work item. Use valid_stage_transition tool to get the list of valid stages you an update to."}, "sprint": {"type": "string", "description": "The DevRev ID of the sprint to be assigned to an issue."}, "subtype": { "type": "object", "properties": { "drop": {"type": "boolean", "description": "If true, the subtype will be dropped from the work item. If false, the subtype will be added to the work item."}, "subtype": {"type": "string", "description": "The subtype value of the work item. Remember to use list_subtypes tool to get the list of valid subtypes."} }, "required": ["drop"] } }, "required": ["id", "type"], }, ), types.Tool( name="list_works", description="List all work items (issues, tickets) in DevRev", inputSchema={ "type": "object", "properties": { "type": {"type": "array", "items": {"type": "string", "enum": ["issue", "ticket"]}, "description": "The type of works to list"}, "cursor": { "type": "object", "properties": { "next_cursor": {"type": "string", "description": "The cursor to use for pagination. If not provided, iteration begins from the first page."}, "mode": {"type": "string", "enum": ["after", "before"], "description": "The mode to iterate after the cursor or before the cursor ."}, }, "required": ["next_cursor", "mode"], "description": "The cursor to use for pagination. If not provided, iteration begins from the first page. In the output you get next_cursor, use it and the correct mode to get the next or previous page. You can use these to loop through all the pages." }, "applies_to_part": {"type": "array", "items": {"type": "string"}, "description": "The part IDs of the works to list"}, "created_by": {"type": "array", "items": {"type": "string"}, "description": "The user IDs of the creators of the works to list"}, "owned_by": {"type": "array", "items": {"type": "string"}, "description": "The user IDs of the owners of the works to list"}, "state": {"type": "array", "items": {"type": "string", "enum": ["open", "closed", "in_progress"]}, "description": "The state names of the works to list"}, "modified_by": {"type": "array", "items": {"type": "string"}, "description": "The user IDs of the users who modified the works to list"}, "sla_summary": { "type": "object", "properties": { "after": {"type": "string", "description": "The start date of the SLA summary range, for example: 2025-06-03T00:00:00Z"}, "before": {"type": "string", "description": "The end date of the SLA summary range, for example: 2025-06-03T00:00:00Z"}, }, "required": ["after", "before"], "description": "Service Level Agreement summary filter on issues to list." }, "sort_by": {"type": "array", "items": {"type": "string", "enum": ["target_start_date:asc", "target_start_date:desc", "target_close_date:asc", "target_close_date:desc", "actual_start_date:asc", "actual_start_date:desc", "actual_close_date:asc", "actual_close_date:desc", "created_date:asc", "created_date:desc"]}, "description": "The field (and the order) to sort the works by, in the sequence of the array elements"}, "rev_orgs": {"type": "array", "items": {"type": "string"}, "description": "The rev_org IDs of the customer rev_orgs filter on Issues and Tickets to list. Use this filter for issues and tickets that are related to a customer rev_org."}, "target_close_date": { "type": "object", "properties": { "after": {"type": "string", "description": "The start date of the target close date range, for example: 2025-06-03T00:00:00Z"}, "before": {"type": "string", "description": "The end date of the target close date range, for example: 2025-06-03T00:00:00Z"}, }, "required": ["after", "before"] }, "target_start_date": { "type": "object", "properties": { "after": {"type": "string", "description": "The start date of the target start date range, for example: 2025-06-03T00:00:00Z"}, "before": {"type": "string", "description": "The end date of the target start date range, for example: 2025-06-03T00:00:00Z"}, }, "description": "The target start date range can only be used for issues. Do not use this field for tickets.", "required": ["after", "before"] }, "actual_close_date": { "type": "object", "properties": { "after": {"type": "string", "description": "The start date of the actual close date range, for example: 2025-06-03T00:00:00Z"}, "before": {"type": "string", "description": "The end date of the actual close date range, for example: 2025-06-03T00:00:00Z"}, }, "required": ["after", "before"] }, "actual_start_date": { "type": "object", "properties": { "after": {"type": "string", "description": "The start date of the actual start date range, for example: 2025-06-03T00:00:00Z"}, "before": {"type": "string", "description": "The end date of the actual start date range, for example: 2025-06-03T00:00:00Z"}, }, "description": "The actual start date range can only be used for issues. Do not use this field for tickets.", "required": ["after", "before"] }, "created_date": { "type": "object", "properties": { "after": {"type": "string", "description": "The start date of the created date range, for example: 2025-06-03T00:00:00Z"}, "before": {"type": "string", "description": "The end date of the created date range, for example: 2025-06-03T00:00:00Z"}, }, "required": ["after", "before"] }, "modified_date": { "type": "object", "properties": { "after": {"type": "string", "description": "The start date of the modified date range, for example: 2025-06-03T00:00:00Z"}, "before": {"type": "string", "description": "The end date of the modified date range, for example: 2025-06-03T00:00:00Z"}, }, "required": ["after", "before"] }, "sprint": { "type": "array", "items": { "type": "string", "description": "The DevRev ID of the sprint to filter on. In DevRev a sprint is a vista group item. You will get these IDs from the response of get vista tool." }, "description": "Use this to filter on sprints." }, "custom_fields": { "type": "array", "items": { "type": "object", "properties": { "name": {"type": "string", "description": "The name of the custom field. All the characters in the name should be lowercase and words separated by underscores. For example: 'custom_field_name'"}, "value": {"type": "array", "items": {"type": "string"}, "description": "The value of the custom field"} }, "required": ["name", "value"] }, "description": "Use this to filter on the custom fields, which are not present in the input schema." }, "subtype": { "type": "array", "items": { "type": "string", "description": "The DevRev value of the subtype to filter on. Remember to always use the list_subtypes tool to check the correct DevRev values of subtypes." }, "description": "Use this to filter on the subtype of the work items." } }, "required": ["type"], }, ), types.Tool( name="get_part", description="Get information about a part (enhancement) in DevRev using its ID", inputSchema={ "type": "object", "properties": {"id": {"type": "string", "description": "The DevRev ID of the part"}}, "required": ["id"], }, ), types.Tool( name="create_part", description="Create a new part (enhancement) in DevRev", inputSchema={ "type": "object", "properties": { "type": {"type": "string", "enum": ["enhancement"]}, "name": {"type": "string"}, "owned_by": {"type": "array", "items": {"type": "string"}, "description": "The DevRev IDs of the users assigned to the part"}, "parent_part": {"type": "array", "items": {"type": "string"}, "description": "The DevRev IDs of the parent parts"}, "description": {"type": "string", "description": "The description of the part"}, }, "required": ["type", "name", "owned_by", "parent_part"], }, ), types.Tool( name="update_part", description="Update an existing part (enhancement) in DevRev", inputSchema={ "type": "object", "properties": { "type": {"type": "string", "enum": ["enhancement"]}, "id": {"type": "string", "description": "The DevRev ID of the part"}, "name": {"type": "string", "description": "The name of the part"}, "owned_by": {"type": "array", "items": {"type": "string"}, "description": "The DevRev IDs of the users assigned to the part"}, "description": {"type": "string", "description": "The description of the part"}, "target_close_date": {"type": "string", "description": "The target closed date of the part, for example: 2025-06-03T00:00:00Z"}, "target_start_date": {"type": "string", "description": "The target start date of the part, for example: 2025-06-03T00:00:00Z"}, "stage": {"type": "string", "description": "The stage DevRev ID of the part. Use valid_stage_transition tool to get the list of valid stages you an update to."}, }, "required": ["id", "type"], }, ), types.Tool( name="list_parts", description="List all parts (enhancements) in DevRev", inputSchema={ "type": "object", "properties": { "type": {"type": "string", "enum": ["enhancement"], "description": "The type of parts to list"}, "cursor": { "type": "object", "properties": { "next_cursor": {"type": "string", "description": "The cursor to use for pagination. If not provided, iteration begins from the first page."}, "mode": {"type": "string", "enum": ["after", "before"], "description": "The mode to iterate after the cursor or before the cursor ."}, }, "required": ["next_cursor", "mode"], "description": "The cursor to use for pagination. If not provided, iteration begins from the first page. In the output you get next_cursor, use it and the correct mode to get the next or previous page. You can use these to loop through all the pages." }, "owned_by": {"type": "array", "items": {"type": "string"}, "description": "The DevRev IDs of the users assigned to the parts to list"}, "parent_part": {"type": "array", "items": {"type": "string"}, "description": "The DevRev IDs of the parent parts to of the parts to list"}, "created_by": {"type": "array", "items": {"type": "string"}, "description": "The DevRev IDs of the users who created the parts to list"}, "modified_by": {"type": "array", "items": {"type": "string"}, "description": "The DevRev IDs of the users who modified the parts to list"}, "sort_by": {"type": "array", "items": {"type": "string", "enum": ["target_close_date:asc", "target_close_date:desc", "target_start_date:asc", "target_start_date:desc", "actual_close_date:asc", "actual_close_date:desc", "actual_start_date:asc", "actual_start_date:desc", "created_date:asc", "created_date:desc", "modified_date:asc", "modified_date:desc"]}, "description": "The field (and the order) to sort the parts by, in the sequence of the array elements"}, "accounts": {"type": "array", "items": {"type": "string"}, "description": "The account IDs of the accounts filter on parts to list"}, "target_close_date": { "type": "object", "properties": { "after": {"type": "string", "description": "The start date of the target close date range, for example: 2025-06-03T00:00:00Z"}, "before": {"type": "string", "description": "The end date of the target close date range, for example: 2025-06-03T00:00:00Z"}, }, "required": ["after", "before"] }, "target_start_date": { "type": "object", "properties": { "after": {"type": "string", "description": "The start date of the target start date range, for example: 2025-06-03T00:00:00Z"}, "before": {"type": "string", "description": "The end date of the target start date range, for example: 2025-06-03T00:00:00Z"}, }, "required": ["after", "before"] }, "actual_close_date": { "type": "object", "properties": { "after": {"type": "string", "description": "The start date of the actual close date range, for example: 2025-06-03T00:00:00Z"}, "before": {"type": "string", "description": "The end date of the actual close date range, for example: 2025-06-03T00:00:00Z"}, }, "required": ["after", "before"] }, "actual_start_date": { "type": "object", "properties": { "after": {"type": "string", "description": "The start date of the actual start date range, for example: 2025-06-03T00:00:00Z"}, "before": {"type": "string", "description": "The end date of the actual start date range, for example: 2025-06-03T00:00:00Z"}, }, "required": ["after", "before"] }, }, "required": ["type"], }, ), types.Tool( name="list_meetings", description="List meetings in DevRev", inputSchema={ "type": "object", "properties": { "channel": { "type": "array", "items": {"type": "string", "enum": ["amazon_connect", "google_meet", "offline", "other", "teams", "zoom"]}, "description": "Filters for meeting on specified channels" }, "created_by": { "type": "array", "items": {"type": "string"}, "description": "Filters for meetings created by the specified user DevRev IDs" }, "created_date": { "type": "object", "properties": { "after": {"type": "string", "description": "The start date of the created date range, for example: 2025-06-03T00:00:00Z"}, "before": {"type": "string", "description": "The end date of the created date range, for example: 2025-06-03T00:00:00Z"} }, "required": ["after", "before"] }, "cursor": { "type": "object", "properties": { "next_cursor": {"type": "string", "description": "The cursor to use for pagination. If not provided, iteration begins from the first page."}, "mode": {"type": "string", "enum": ["after", "before"], "description": "The mode to iterate after the cursor or before the cursor"} }, "required": ["next_cursor", "mode"] }, "ended_date": { "type": "object", "properties": { "after": {"type": "string", "description": "The start date of the ended date range, for example: 2025-06-03T00:00:00Z"}, "before": {"type": "string", "description": "The end date of the ended date range, for example: 2025-06-03T00:00:00Z"} }, "required": ["after", "before"] }, "external_ref": { "type": "array", "items": {"type": "string"}, "description": "Filters for meetings with the provided external_ref(s)" }, "limit": { "type": "integer", "description": "The maximum number of meetings to return" }, "members": { "type": "array", "items": {"type": "string"}, "description": "Filter for meeting on specified Member Ids" }, "modified_date": { "type": "object", "properties": { "after": {"type": "string", "description": "The start date of the modified date range, for example: 2025-06-03T00:00:00Z"}, "before": {"type": "string", "description": "The end date of the modified date range, for example: 2025-06-03T00:00:00Z"} }, "required": ["after", "before"] }, "organizer": { "type": "array", "items": {"type": "string"}, "description": "Filter for meeting on specified organizers" }, "scheduled_date": { "type": "object", "properties": { "after": {"type": "string", "description": "The start date of the scheduled date range, for example: 2025-06-03T00:00:00Z"}, "before": {"type": "string", "description": "The end date of the scheduled date range, for example: 2025-06-03T00:00:00Z"} }, "required": ["after", "before"] }, "sort_by": { "type": "array", "items": { "type": "string", "enum": ["target_start_date:asc", "target_start_date:desc", "target_close_date:asc", "target_close_date:desc", "actual_start_date:asc", "actual_start_date:desc", "actual_close_date:asc", "actual_close_date:desc", "created_date:asc", "created_date:desc", "modified_date:asc", "modified_date:desc"] }, "description": "The field (and the order) to sort the meetings by, in the sequence of the array elements" }, "state": { "type": "array", "items": {"type": "string", "enum": ["cancelled", "completed", "no_show", "ongoing", "rejected", "scheduled", "rescheduled", "waiting"]}, "description": "Filters for meeting on specified state or outcomes" } } } ), types.Tool( name="valid_stage_transition", description="gets a list of valid stage transition for a given work item (issue, ticket) or part (enhancement). Use this before updating stage of the work item or part to ensure the transition is valid.", inputSchema={ "type": "object", "properties": { "type": {"type": "string", "enum": ["issue", "ticket", "enhancement"]}, "id": {"type": "string", "description": "The DevRev ID of the work item (issue, ticket) or part (enhancement)"}, }, "required": ["type", "id"] } ), types.Tool( name="add_timeline_entry", description="Add a timeline entry to a work item (issue, ticket) or part (enhancement)", inputSchema={ "type": "object", "properties": { "id": {"type": "string", "description": "The DevRev ID of the work item (issue, ticket) or part (enhancement)"}, "timeline_entry": {"type": "string", "description": "The timeline entry about updates to the work item (issue, ticket) or part (enhancement)."}, }, "required": ["id", "timeline_entry"], } ), types.Tool( name="get_sprints", description="Get active or planned sprints for a given part ID. Use this to get the sprints for an issue based on its part.", inputSchema={ "type": "object", "properties": { "ancestor_part_id": {"type": "string", "description": "The ID of the part to get the sprints for."}, "state": { "type": "string", "enum": ["active", "planned"], "description": "The state of the sprints to get. When the state is not provided in query, the tool will get the active sprints." }, }, "required": ["ancestor_part_id"], }, ), types.Tool( name="list_subtypes", description="List all subtypes in DevRev for a given leaf type", inputSchema={ "type": "object", "properties": { "leaf_type": {"type": "string", "enum": ["issue", "ticket"]}, }, "required": ["leaf_type"], } ) ]
  • Helper function to make authenticated POST requests to DevRev API, used by the create_part handler to call 'parts.create' endpoint.
    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 )

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