Skip to main content
Glama

List media

wp_list_media
Read-onlyIdempotent

List WordPress media library files newest first or by search relevance, with pagination and optional MIME-type filtering. Returns each attachment's ID, title, MIME type, URL, and date.

Instructions

List files in the media library (attachments), newest first, or by relevance when search is given. Returns items: [{id, title, mime, url, date}] and pagination {total, total_pages}. Only files with the usual status "inherit" are listed, so files set to private are not, and only those the account may read. No match gives an empty list. Needs upload_files. Read-only; wp_get_media returns one file with its sizes, alt text and caption.

Input Schema

NameRequiredDescriptionDefault
mimeNoMIME type or its main part, e.g. "image", "image/png" or "application/pdf". Default: all types.
pageNoPage number, starting at 1. Default 1.
searchNoSearch text, matched against title, caption and description.
per_pageNoFiles per page, 1–100; other values are clamped. Default 20.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv4.7.0

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already cover the safety profile (readOnly, idempotent, non-destructive), yet the description adds real substance: the exact status filter applied, the capability requirement (upload_files), permission-scoped results, and the empty-result behavior. That is context an agent cannot derive from the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Four tight sentences, front-loaded with the purpose and ordering, then results, then filters, then the sibling pointer. Every clause carries information; nothing is redundant with the schema or annotations.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, so spelling out the returned item shape ({id, title, mime, url, date}) and pagination fields ({total, total_pages}) is necessary and present. Combined with the filtering and permission notes, an agent has everything needed to call and interpret this tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3; the description earns above that by linking 'search' to a change in sort order (relevance instead of newest first), which the schema does not state. The mime and pagination parameters are left entirely to the schema, keeping it from a 5.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('List files in the media library (attachments)') plus the ordering rule, which is exactly what distinguishes it from a generic list. It also names the sibling wp_get_media and what that one returns, so an agent can route without opening either schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives clear operating context: search switches ordering to relevance, only 'inherit'-status files are returned, private files are excluded, and the account needs upload_files. It routes to wp_get_media for single-file detail, though it frames that as a statement rather than an explicit 'use X when' rule, so it stops short of the top band.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools