Open Context Protocol is live! 🚀 Read the launch post

getFolderAncestors

Get all ancestors of folder

Details

  • Method: GET
  • Path: /folders/{id}/ancestors
  • Operation ID: getFolderAncestors

Parameters

{
  "id": {
    "description": "The ID of the folder.",
    "required": true,
    "location": "path",
    "type": "integer",
    "format": "int64"
  },
  "limit": {
    "description": "Maximum number of items per result to return. If more results exist, call the endpoint with the highest ancestor's ID to fetch the next set of results.",
    "required": false,
    "location": "query",
    "type": "integer",
    "format": "int32"
  }
}

Response Schema

{
  "title": "MultiEntityResult<Ancestor>",
  "type": "object",
  "properties": {
    "results": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "ID of the ancestor"
          },
          "type": {
            "enum": [
              "page",
              "whiteboard",
              "database",
              "embed",
              "folder"
            ],
            "type": "string",
            "description": "The type of ancestor."
          }
        }
      }
    }
  }
}

Usage

from ocp_agent import OCPAgent

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

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