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

projectsAddFieldForUser

Add field to user owned project

Details

  • Method: POST
  • Path: /users/{username}/projectsV2/{project_number}/fields
  • Operation ID: projects/add-field-for-user

Parameters

{
  "username": {
    "description": "The handle for the GitHub user account.",
    "required": true,
    "location": "path",
    "type": "string"
  },
  "project_number": {
    "description": "The project's number.",
    "required": true,
    "location": "path",
    "type": "integer"
  }
}

Response Schema

{
  "title": "Projects v2 Field",
  "description": "A field inside a projects v2 project",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "description": "The unique identifier of the field."
    },
    "node_id": {
      "type": "string",
      "description": "The node ID of the field."
    },
    "project_url": {
      "type": "string",
      "description": "The API URL of the project that contains the field.",
      "example": "https://api.github.com/projects/1"
    },
    "name": {
      "type": "string",
      "description": "The name of the field."
    },
    "data_type": {
      "type": "string",
      "description": "The field's data type.",
      "enum": [
        "assignees",
        "linked_pull_requests",
        "reviewers",
        "labels",
        "milestone",
        "repository",
        "title",
        "text",
        "single_select",
        "number",
        "date",
        "iteration",
        "issue_type",
        "parent_issue",
        "sub_issues_progress"
      ]
    },
    "options": {
      "type": "array",
      "description": "The options available for single select fields.",
      "items": {
        "title": "Projects v2 Single Select Option",
        "description": "An option for a single select field",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The unique identifier of the option."
          },
          "name": {
            "type": "object",
            "description": "The display name of the option, in raw text and HTML formats.",
            "properties": {
              "raw": {
                "type": "string"
              },
              "html": {
                "type": "string"
              }
            },
            "required": [
              "raw",
              "html"
            ]
          },
          "description": {
            "type": "object",
            "description": "The description of the option, in raw text and HTML formats.",
            "properties": {
              "raw": {
                "type": "string"
              },
              "html": {
                "type": "string"
              }
            },
            "required": [
              "raw",
              "html"
            ]
          },
          "color": {
            "type": "string",
            "description": "The color associated with the option."
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "color"
        ]
      }
    },
    "configuration": {
      "type": "object",
      "description": "Configuration for iteration fields.",
      "properties": {
        "start_day": {
          "type": "integer",
          "description": "The day of the week when the iteration starts."
        },
        "duration": {
          "type": "integer",
          "description": "The duration of the iteration in days."
        },
        "iterations": {
          "type": "array",
          "items": {
            "title": "Projects v2 Iteration Setting",
            "description": "An iteration setting for an iteration field",
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "The unique identifier of the iteration setting."
              },
              "start_date": {
                "type": "string",
                "format": "date",
                "description": "The start date of the iteration."
              },
              "duration": {
                "type": "integer",
                "description": "The duration of the iteration in days."
              },
              "title": {
                "type": "object",
                "properties": {
                  "raw": {
                    "type": "string"
                  },
                  "html": {
                    "type": "string"
                  }
                },
                "required": [
                  "raw",
                  "html"
                ],
                "description": "The iteration title, in raw text and HTML formats."
              },
              "completed": {
                "type": "boolean",
                "description": "Whether the iteration has been completed."
              }
            },
            "required": [
              "id",
              "start_date",
              "duration",
              "title",
              "completed"
            ]
          }
        }
      }
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "example": "2022-04-28T12:00:00Z",
      "description": "The time when the field was created."
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "example": "2022-04-28T12:00:00Z",
      "description": "The time when the field was last updated."
    }
  },
  "required": [
    "id",
    "name",
    "data_type",
    "created_at",
    "updated_at",
    "project_url"
  ]
}

Usage

from ocp_agent import OCPAgent

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

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