Open Context Protocol is live! 🚀 Read the launch post

getAttachment

Get attachment metadata

Details

  • Method: GET
  • Path: /rest/api/3/attachment/{id}
  • Operation ID: getAttachment

Parameters

{
  "id": {
    "description": "The ID of the attachment.",
    "required": true,
    "location": "path",
    "type": "string"
  }
}

Response Schema

{
  "additionalProperties": false,
  "description": "Metadata for an issue attachment.",
  "properties": {
    "author": {
      "allOf": [
        {
          "$ref": "#/components/schemas/User"
        }
      ],
      "description": "Details of the user who attached the file.",
      "readOnly": true
    },
    "content": {
      "description": "The URL of the attachment.",
      "readOnly": true,
      "type": "string"
    },
    "created": {
      "description": "The datetime the attachment was created.",
      "format": "date-time",
      "readOnly": true,
      "type": "string"
    },
    "filename": {
      "description": "The name of the attachment file.",
      "readOnly": true,
      "type": "string"
    },
    "id": {
      "description": "The ID of the attachment.",
      "format": "int64",
      "readOnly": true,
      "type": "integer"
    },
    "mimeType": {
      "description": "The MIME type of the attachment.",
      "readOnly": true,
      "type": "string"
    },
    "properties": {
      "additionalProperties": {
        "readOnly": true
      },
      "description": "Additional properties of the attachment.",
      "readOnly": true,
      "type": "object"
    },
    "self": {
      "description": "The URL of the attachment metadata details.",
      "format": "uri",
      "readOnly": true,
      "type": "string"
    },
    "size": {
      "description": "The size of the attachment.",
      "format": "int64",
      "readOnly": true,
      "type": "integer"
    },
    "thumbnail": {
      "description": "The URL of a thumbnail representing the attachment.",
      "readOnly": true,
      "type": "string"
    }
  },
  "type": "object",
  "xml": {
    "name": "attachment"
  }
}

Usage

from ocp_agent import OCPAgent

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

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