Get Media Details


Gets the full details of a single media item by its ID: URL, filename, mime type, file size, uploader, upload date, what it is attached to, caption, description, and (for images) alt text and dimensions.

Property Value
Ability slug mosmcp/media-get
Wire tool name mosmcp__media-get
Category Media (mosmcp-media)
Plan Free

 

Required access

Requirement Value
Capability upload_files
Minimum default role Author
Annotations readOnly: true · destructive: false · idempotent: true · openWorld: false

 

Input schema

Field Type Required Default Description
id integer (min 1) Yes — The ID of the media item to retrieve.

 

Output schema

Field Type Required
id integer Yes
title string Yes
filename string
mime_type string Yes
file_size string
url string Yes
uploaded_on string
uploader string
attached_to_id integer
attached_to_title string
edit_url string
caption string
description string
alt_text string
width integer
height integer

 

Example

Sample prompt
Show me the details of media item 318, including its alt text and size.

Example request (json)

{
  "jsonrpc": "2.0",
  "id": 86,
  "method": "tools/call",
  "params": {
    "name": "mosmcp__media-get",
    "arguments": {
      "input": {
        "id": 318
      }
    }
  }
}

Example response (json)

{
  "jsonrpc": "2.0",
  "id": 86,
  "result": {
    "isError": false,
    "structuredContent": {
      "id": 318,
      "title": "summer-banner",
      "filename": "summer-banner.jpg",
      "mime_type": "image/jpeg",
      "file_size": "245 KB",
      "url": "https://example.com/wp-content/uploads/2026/06/summer-banner.jpg",
      "uploaded_on": "2026-06-14 09:32:10",
      "uploader": "Jane Doe",
      "attached_to_id": 42,
      "attached_to_title": "Summer Sale",
      "edit_url": "https://example.com/wp-admin/post.php?post=318&action=edit",
      "caption": "Our summer collection",
      "description": "",
      "alt_text": "Models wearing summer outfits on a beach",
      "width": 1920,
      "height": 800
    }
  }
}

 

Edge cases / errors

  • id that does not exist or is not an attachment (e.g. a post ID) → error media_not_found.
  • Physical file missing from disk → file_size is "unknown" and filename may be empty; the rest of the record is still returned.
  • Non-image files → width and height are 0 and alt_text is usually empty.
  • Unattached media → attached_to_id is 0 and attached_to_title is empty.

 


<< Previous Next >>
Find Media (ID by Name / Name by ID) List All Media

For more information about the Secure MCP Server for WordPress plugin, explore the following resources:

Product Overview | Pricing | Try for Free | Documentation

If you have any questions regarding plugin configuration, pricing plans or licensing, please contact us or mail us at aisupport@xecurify.com.