Open Context Protocol is live! 🚀 Read the launch post

getTaskById

Get task by id

Details

  • Method: GET
  • Path: /tasks/{id}
  • Operation ID: getTaskById

Parameters

{
  "id": {
    "description": "The ID of the task to be returned. If you don't know the task ID, use Get tasks and filter the results.",
    "required": true,
    "location": "path",
    "type": "integer",
    "format": "int64"
  },
  "body-format": {
    "description": "The content format types to be returned in the `body` field of the response. If available, the representation will be available under a response field of the same name under the `body` field.",
    "required": false,
    "location": "query",
    "type": "string",
    "enum": [
      "storage",
      "atlas_doc_format"
    ]
  }
}

Response Schema

{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "ID of the task."
    },
    "localId": {
      "type": "string",
      "description": "Local ID of the task. This ID is local to the corresponding page or blog post."
    },
    "spaceId": {
      "type": "string",
      "description": "ID of the space the task is in."
    },
    "pageId": {
      "type": "string",
      "description": "ID of the page the task is in."
    },
    "blogPostId": {
      "type": "string",
      "description": "ID of the blog post the task is in."
    },
    "status": {
      "enum": [
        "complete",
        "incomplete"
      ],
      "type": "string",
      "description": "Status of the task."
    },
    "body": {
      "type": "object",
      "description": "Contains fields for each representation type requested.",
      "properties": {
        "storage": {
          "type": "object",
          "properties": {
            "representation": {
              "type": "string",
              "description": "Type of content representation used for the value field."
            },
            "value": {
              "type": "string",
              "description": "Body of the content, in the format found in the representation field."
            }
          }
        },
        "atlas_doc_format": {
          "type": "object",
          "properties": {
            "representation": {
              "type": "string",
              "description": "Type of content representation used for the value field."
            },
            "value": {
              "type": "string",
              "description": "Body of the content, in the format found in the representation field."
            }
          }
        }
      }
    },
    "createdBy": {
      "type": "string",
      "description": "Account ID of the user who created this task."
    },
    "assignedTo": {
      "type": "string",
      "description": "Account ID of the user to whom this task is assigned."
    },
    "completedBy": {
      "type": "string",
      "description": "Account ID of the user who completed this task."
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "description": "Date and time when the task was created. In format \"YYYY-MM-DDTHH:mm:ss.sssZ\"."
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time",
      "description": "Date and time when the task was updated. In format \"YYYY-MM-DDTHH:mm:ss.sssZ\"."
    },
    "dueAt": {
      "type": "string",
      "format": "date-time",
      "description": "Date and time when the task is due. In format \"YYYY-MM-DDTHH:mm:ss.sssZ\"."
    },
    "completedAt": {
      "type": "string",
      "format": "date-time",
      "description": "Date and time when the task was completed. In format \"YYYY-MM-DDTHH:mm:ss.sssZ\"."
    }
  }
}

Usage

from ocp_agent import OCPAgent

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

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