Get message attachments
discord_
Read-only
- Toolset
- Messages
messages - Discord permissions
- View Channel and Read Message History
- Context cost
- 519 tokens, estimated2,074 bytes of definition, divided by 4
List the file attachments of a message. Returns { attachments: [...] } with id, filename, title (the original name when Discord strips non-ASCII from filename), url, proxyUrl, contentType, size in bytes, width, height, alt-text description, voice-message duration and waveform, spoiler flag. Discord signs CDN urls with a 24-hour expiry and does not re-sign on every fetch; re-call this tool if a stored url has expired. Requires the View Channel and Read Message History permissions. Without the Message Content privileged intent, enabled in the Developer Portal, Discord returns no attachments for other users' messages unless they mention the bot. A forwarded message's files sit in its snapshot and are not listed. Read-only. Use discord_ to find messages with attachments.
Risk and annotations
Read-onlyreadOnlyHint | yes | Does not modify your server. |
|---|---|---|
DestructivedestructiveHint | n/a | Not declared: it only applies to tools that write. |
IdempotentidempotentHint | n/a | Not declared. |
Open worldopenWorldHint | yes | Interacts with an external system: Discord. |
Annotations are hints the server declares. Clients use them to decide when to ask you before a call.
Parameters
| Parameter | Type | Rules | Description |
|---|---|---|---|
| channel_ | string | pattern ^\d{17,20}$ | ID (snowflake) of the channel or thread containing the message. |
| message_ | string | pattern ^\d{17,20}$ | ID of the message whose attachments to list. |
Output
Declared by outputSchema: clients receive this shape as structuredContent.
| Field | Type |
|---|---|
| attachmentsrequired | array of objects |
| id (nested, level 1)required | string |
| filename (nested, level 1)required | string |
| contentType (nested, level 1)required | string or null |
| size (nested, level 1)required | number |
| url (nested, level 1)required | string |
| proxyUrl (nested, level 1)required | string |
| width (nested, level 1)required | number or null |
| height (nested, level 1)required | number or null |
| description (nested, level 1)required | string or null |
| title (nested, level 1)required | string or null |
| duration (nested, level 1)required | number or null |
| waveform (nested, level 1)required | string or null |
| spoiler (nested, level 1)required | boolean |
Related tools
Named in its description
Also in Messages
-
Send message, Write
discord_send_ message -
Reply to message, Write
discord_reply_ message -
Edit message, Write
discord_edit_ message -
Add reaction, Write
discord_add_ reaction -
List channel threads, Read-only
discord_list_ channel_ threads -
Create thread, Write
discord_create_ thread -
Bulk delete messages, Destructive
discord_bulk_ delete_ messages -
Send embed, Write
discord_send_ embed -
Edit embed, Write
discord_edit_ embed -
Send multiple embeds, Write
discord_send_ multiple_ embeds -
Delete message, Destructive
discord_delete_ message -
Pin or unpin message, Write
discord_pin_ message -
Search messages, Read-only
discord_search_ messages -
Search guild messages, Read-only
discord_search_ guild_ messages -
Crosspost message, Write
discord_crosspost_ message -
Remove reactions, Destructive
discord_remove_ reactions -
Get reactions, Read-only
discord_get_ reactions -
Fetch pinned messages, Read-only
discord_fetch_ pinned_ messages -
Forward message, Write
discord_forward_ message
Raw definition (2,074 bytes)
{
"name": "discord_get_message_attachments",
"description": "List the file attachments of a message. Returns { attachments: [...] } with id, filename, title (the original name when Discord strips non-ASCII from filename), url, proxyUrl, contentType, size in bytes, width, height, alt-text description, voice-message duration and waveform, spoiler flag. Discord signs CDN urls with a 24-hour expiry and does not re-sign on every fetch; re-call this tool if a stored url has expired. Requires the View Channel and Read Message History permissions. Without the Message Content privileged intent, enabled in the Developer Portal, Discord returns no attachments for other users' messages unless they mention the bot. A forwarded message's files sit in its snapshot and are not listed. Read-only. Use discord_read_messages to find messages with attachments.",
"inputSchema": {
"type": "object",
"properties": {
"channel_id": {
"type": "string",
"pattern": "^\\d{17,20}$",
"description": "ID (snowflake) of the channel or thread containing the message."
},
"message_id": {
"type": "string",
"pattern": "^\\d{17,20}$",
"description": "ID of the message whose attachments to list."
}
},
"required": [
"channel_id",
"message_id"
],
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"properties": {
"attachments": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"filename": {
"type": "string"
},
"contentType": {
"type": [
"string",
"null"
]
},
"size": {
"type": "number"
},
"url": {
"type": "string"
},
"proxyUrl": {
"type": "string"
},
"width": {
"type": [
"number",
"null"
]
},
"height": {
"type": [
"number",
"null"
]
},
"description": {
"type": [
"string",
"null"
]
},
"title": {
"type": [
"string",
"null"
]
},
"duration": {
"type": [
"number",
"null"
]
},
"waveform": {
"type": [
"string",
"null"
]
},
"spoiler": {
"type": "boolean"
}
},
"required": [
"id",
"filename",
"contentType",
"size",
"url",
"proxyUrl",
"width",
"height",
"description",
"title",
"duration",
"waveform",
"spoiler"
],
"additionalProperties": false
}
}
},
"required": [
"attachments"
],
"additionalProperties": false
},
"annotations": {
"title": "Get message attachments",
"readOnlyHint": true,
"openWorldHint": true
}
}