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

projectsListFieldsForUser

List project fields for user

Details

  • Method: GET
  • Path: /users/{username}/projectsV2/{project_number}/fields
  • Operation ID: projects/list-fields-for-user

Parameters

{
  "project_number": {
    "description": "The project's number.",
    "required": true,
    "location": "path",
    "type": "integer"
  },
  "username": {
    "description": "The handle for the GitHub user account.",
    "required": true,
    "location": "path",
    "type": "string"
  },
  "per_page": {
    "description": "The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"",
    "required": false,
    "location": "query",
    "type": "integer"
  },
  "before": {
    "description": "A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"",
    "required": false,
    "location": "query",
    "type": "string"
  },
  "after": {
    "description": "A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"",
    "required": false,
    "location": "query",
    "type": "string"
  }
}

Response Schema

{
  "type": "array",
  "items": {
    "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('projectsListFieldsForUser', {
    # Add required parameters here
})