Open Context Protocol is live! 🚀 Read the launch post
issuesCreateLabel

issuesCreateLabel

Create a label

Details

  • Method: POST
  • Path: /repos/{owner}/{repo}/labels
  • Operation ID: issues/create-label

Parameters

{
  "owner": {
    "description": "The account owner of the repository. The name is not case sensitive.",
    "required": true,
    "location": "path",
    "type": "string"
  },
  "repo": {
    "description": "The name of the repository without the `.git` extension. The name is not case sensitive.",
    "required": true,
    "location": "path",
    "type": "string"
  },
  "name": {
    "description": "The name of the label. Emoji can be added to label names, using either native emoji or colon-style markup. For example, typing `:strawberry:` will render the emoji ![:strawberry:](https://github.githubassets.com/images/icons/emoji/unicode/1f353.png \":strawberry:\"). For a full list of available emoji and codes, see \"[Emoji cheat sheet](https://github.com/ikatyang/emoji-cheat-sheet).\"",
    "required": true,
    "location": "body",
    "type": "string"
  },
  "color": {
    "description": "The [hexadecimal color code](http://www.color-hex.com/) for the label, without the leading `#`.",
    "required": false,
    "location": "body",
    "type": "string"
  },
  "description": {
    "description": "A short description of the label. Must be 100 characters or fewer.",
    "required": false,
    "location": "body",
    "type": "string"
  }
}

Response Schema

{
  "title": "Label",
  "description": "Color-coded labels help you categorize and filter your issues (just like labels in Gmail).",
  "type": "object",
  "properties": {
    "id": {
      "description": "Unique identifier for the label.",
      "type": "integer",
      "format": "int64",
      "example": 208045946
    },
    "node_id": {
      "type": "string",
      "example": "MDU6TGFiZWwyMDgwNDU5NDY="
    },
    "url": {
      "description": "URL for the label",
      "example": "https://api.github.com/repositories/42/labels/bug",
      "type": "string",
      "format": "uri"
    },
    "name": {
      "description": "The name of the label.",
      "example": "bug",
      "type": "string"
    },
    "description": {
      "description": "Optional description of the label, such as its purpose.",
      "type": "string",
      "example": "Something isn't working",
      "nullable": true
    },
    "color": {
      "description": "6-character hex code, without the leading #, identifying the color",
      "example": "FFFFFF",
      "type": "string"
    },
    "default": {
      "description": "Whether this label comes by default in a new repository.",
      "type": "boolean",
      "example": true
    }
  },
  "required": [
    "id",
    "node_id",
    "url",
    "name",
    "description",
    "color",
    "default"
  ]
}

Usage

from ocp_agent import OCPAgent

agent = OCPAgent()
await agent.register_api('github')

# Call this tool
result = await agent.call_tool('issuesCreateLabel', {
    # Add required parameters here
})