Open Context Protocol is live! 🚀 Read the launch post

filesInfo

Gets information about a file.

Details

  • Method: GET
  • Path: /files.info
  • Operation ID: files_info

Parameters

{
  "token": {
    "description": "Authentication token. Requires scope: `files:read`",
    "required": false,
    "location": "query",
    "type": "string"
  },
  "file": {
    "description": "Specify a file by providing its ID.",
    "required": false,
    "location": "query",
    "type": "string"
  },
  "count": {
    "description": "",
    "required": false,
    "location": "query",
    "type": "string"
  },
  "page": {
    "description": "",
    "required": false,
    "location": "query",
    "type": "string"
  },
  "limit": {
    "description": "The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached.",
    "required": false,
    "location": "query",
    "type": "string"
  },
  "cursor": {
    "description": "Parameter for pagination. File comments are paginated for a single file. Set `cursor` equal to the `next_cursor` attribute returned by the previous request's `response_metadata`. This parameter is optional, but pagination is mandatory: the default value simply fetches the first \"page\" of the collection of comments. See [pagination](/docs/pagination) for more details.",
    "required": false,
    "location": "query",
    "type": "string"
  }
}

Response Schema

{
  "additionalProperties": false,
  "description": "Schema for successful response from files.info method",
  "properties": {
    "comments": {
      "items": {},
      "title": "file comments object",
      "type": "array"
    },
    "content_html": {
      "type": "null"
    },
    "editor": {
      "pattern": "^[UW][A-Z0-9]{2,}$",
      "title": "User ID",
      "type": "string"
    },
    "file": {
      "additionalProperties": false,
      "properties": {
        "channels": {
          "items": {
            "pattern": "^[C][A-Z0-9]{2,}$",
            "title": "Channel ID",
            "type": "string"
          },
          "type": "array",
          "uniqueItems": true
        },
        "comments_count": {
          "type": "integer"
        },
        "created": {
          "type": "integer"
        },
        "date_delete": {
          "type": "integer"
        },
        "display_as_bot": {
          "type": "boolean"
        },
        "editable": {
          "type": "boolean"
        },
        "editor": {
          "pattern": "^[UW][A-Z0-9]{2,}$",
          "title": "User ID",
          "type": "string"
        },
        "external_id": {
          "type": "string"
        },
        "external_type": {
          "type": "string"
        },
        "external_url": {
          "format": "uri",
          "type": "string"
        },
        "filetype": {
          "type": "string"
        },
        "groups": {
          "items": {
            "pattern": "^[G][A-Z0-9]{8,}$",
            "title": "Private Channel ID",
            "type": "string"
          },
          "type": "array",
          "uniqueItems": true
        },
        "has_rich_preview": {
          "type": "boolean"
        },
        "id": {
          "pattern": "^[F][A-Z0-9]{8,}$",
          "title": "File ID",
          "type": "string"
        },
        "image_exif_rotation": {
          "type": "integer"
        },
        "ims": {
          "items": {
            "pattern": "^[D][A-Z0-9]{8,}$",
            "title": "Direct Message Channel ID",
            "type": "string"
          },
          "type": "array",
          "uniqueItems": true
        },
        "is_external": {
          "type": "boolean"
        },
        "is_public": {
          "type": "boolean"
        },
        "is_starred": {
          "type": "boolean"
        },
        "is_tombstoned": {
          "type": "boolean"
        },
        "last_editor": {
          "pattern": "^[UW][A-Z0-9]{2,}$",
          "title": "User ID",
          "type": "string"
        },
        "mimetype": {
          "type": "string"
        },
        "mode": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "non_owner_editable": {
          "type": "boolean"
        },
        "num_stars": {
          "type": "integer"
        },
        "original_h": {
          "type": "integer"
        },
        "original_w": {
          "type": "integer"
        },
        "permalink": {
          "format": "uri",
          "type": "string"
        },
        "permalink_public": {
          "format": "uri",
          "type": "string"
        },
        "pinned_info": {
          "additionalProperties": false,
          "title": "Info for a pinned item",
          "type": "object"
        },
        "pinned_to": {
          "items": {
            "pattern": "^[CGD][A-Z0-9]{8,}$",
            "title": "Channel-like conversation ID",
            "type": "string"
          },
          "type": "array"
        },
        "pretty_type": {
          "type": "string"
        },
        "preview": {
          "type": "string"
        },
        "public_url_shared": {
          "type": "boolean"
        },
        "reactions": {
          "items": {
            "additionalProperties": true,
            "properties": {
              "count": {
                "type": "integer"
              },
              "name": {
                "type": "string"
              },
              "users": {
                "items": {
                  "pattern": "^[UW][A-Z0-9]{2,}$",
                  "title": "User ID",
                  "type": "string"
                },
                "type": "array"
              }
            },
            "required": [
              "name",
              "users",
              "count"
            ],
            "title": "Reaction object",
            "type": "object"
          },
          "type": "array"
        },
        "shares": {
          "additionalProperties": false,
          "properties": {
            "private": {
              "additionalProperties": false
            },
            "public": {
              "additionalProperties": false
            }
          },
          "type": "object"
        },
        "size": {
          "type": "integer"
        },
        "source_team": {
          "pattern": "^[T][A-Z0-9]{2,}$",
          "title": "Team ID",
          "type": "string"
        },
        "state": {
          "type": "string"
        },
        "thumb_1024": {
          "format": "uri",
          "type": "string"
        },
        "thumb_1024_h": {
          "type": "integer"
        },
        "thumb_1024_w": {
          "type": "integer"
        },
        "thumb_160": {
          "format": "uri",
          "type": "string"
        },
        "thumb_360": {
          "format": "uri",
          "type": "string"
        },
        "thumb_360_h": {
          "type": "integer"
        },
        "thumb_360_w": {
          "type": "integer"
        },
        "thumb_480": {
          "format": "uri",
          "type": "string"
        },
        "thumb_480_h": {
          "type": "integer"
        },
        "thumb_480_w": {
          "type": "integer"
        },
        "thumb_64": {
          "format": "uri",
          "type": "string"
        },
        "thumb_720": {
          "format": "uri",
          "type": "string"
        },
        "thumb_720_h": {
          "type": "integer"
        },
        "thumb_720_w": {
          "type": "integer"
        },
        "thumb_80": {
          "format": "uri",
          "type": "string"
        },
        "thumb_800": {
          "format": "uri",
          "type": "string"
        },
        "thumb_800_h": {
          "type": "integer"
        },
        "thumb_800_w": {
          "type": "integer"
        },
        "thumb_960": {
          "format": "uri",
          "type": "string"
        },
        "thumb_960_h": {
          "type": "integer"
        },
        "thumb_960_w": {
          "type": "integer"
        },
        "thumb_tiny": {
          "type": "string"
        },
        "timestamp": {
          "type": "integer"
        },
        "title": {
          "type": "string"
        },
        "updated": {
          "type": "integer"
        },
        "url_private": {
          "format": "uri",
          "type": "string"
        },
        "url_private_download": {
          "format": "uri",
          "type": "string"
        },
        "user": {
          "type": "string"
        },
        "user_team": {
          "pattern": "^[T][A-Z0-9]{2,}$",
          "title": "Team ID",
          "type": "string"
        },
        "username": {
          "type": "string"
        }
      },
      "title": "file object",
      "type": "object"
    },
    "ok": {
      "enum": [
        true
      ],
      "title": "default success response",
      "type": "boolean"
    },
    "paging": {
      "additionalProperties": false,
      "properties": {
        "count": {
          "type": "integer"
        },
        "page": {
          "type": "integer"
        },
        "pages": {
          "type": "integer"
        },
        "per_page": {
          "type": "integer"
        },
        "spill": {
          "type": "integer"
        },
        "total": {
          "type": "integer"
        }
      },
      "required": [
        "page",
        "total"
      ],
      "title": "paging object",
      "type": "object"
    },
    "response_metadata": {
      "items": [
        {
          "additionalProperties": false,
          "properties": {
            "next_cursor": {
              "type": "string"
            }
          },
          "required": [
            "next_cursor"
          ],
          "title": "new paging style",
          "type": "object"
        },
        {
          "additionalProperties": false,
          "properties": {
            "messages": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "warnings": {
              "items": {
                "enum": [
                  "method_deprecated"
                ],
                "type": "string"
              },
              "type": "array"
            }
          },
          "required": [
            "messages",
            "warnings"
          ],
          "title": "deprecation_warning",
          "type": "object"
        },
        {
          "additionalProperties": false,
          "properties": {
            "messages": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "next_cursor": {
              "type": "string"
            },
            "warnings": {
              "items": {
                "enum": [
                  "method_deprecated"
                ],
                "type": "string"
              },
              "type": "array"
            }
          },
          "required": [
            "messages",
            "warnings",
            "next_cursor"
          ],
          "title": "deprecation_warning and paging style together",
          "type": "object"
        }
      ]
    }
  },
  "required": [
    "ok",
    "file",
    "comments"
  ],
  "title": "files.info schema",
  "type": "object"
}

Usage

from ocp_agent import OCPAgent

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

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