Skip to main content
Glama

Read post meta

wp_get_post_meta
Read-onlyIdempotent

Read one post's custom fields by key or retrieve all public keys, with protected and credential-like keys excluded. Use it to inspect post meta values directly.

Instructions

Read custom fields (post meta) of one post: one key, or all public keys. Keys starting with "_", keys WordPress marks as protected and credential-like keys are not available, and keys are returned only where the account may edit the post (and the key). Returns {id, key, value} (with several stored values, the first) or {id, meta: {key: value}} (a key with several values gives a list). An unknown post id returns a not-found error. Read-only. wp_get_post returns the same keys along with the post; page builder layouts are read with wp_get_builder_layout, SEO fields with wp_seo_get.

Input Schema

NameRequiredDescriptionDefault
idYesPost id.
keyNoOne meta key to read. When omitted, all public keys are read. A key the post does not have returns an empty value, or the default a plugin registered for it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv4.7.0

TDQS

A4.9/5.0
Behavior5/5

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

The annotations already declare read-only, idempotent, non-destructive behavior, but the description adds critical context beyond them: underscore-prefixed, protected, and credential-like keys are unavailable, access is gated by edit capability, and an unknown post id returns a not-found error. It also describes return shapes for single-key and all-key reads.

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?

The description is dense but front-loaded: purpose first, then access restrictions, return shapes, error behavior, safety, and alternatives. Every sentence adds operational value, and no space is wasted on restating the name or title.

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?

With no output schema, the description carries the return-value burden and does so by describing both {id, key, value} and {id, meta: {key: value}} responses. It also covers access restrictions, unknown-post errors, and alternatives, making it complete for a two-parameter read 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 the baseline is 3. The description still adds useful semantic detail about the key parameter: only public keys are returned when key is omitted, protected and credential-like keys are excluded, and a key with several stored values may yield a list in the all-keys response.

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?

The description states a specific verb and resource: reading custom fields (post meta) of one post. It clearly distinguishes scope by saying one key or all public keys, and later names wp_get_post, wp_get_builder_layout, and wp_seo_get as related alternatives.

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

Usage Guidelines5/5

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

It explicitly names alternatives and when to prefer them: wp_get_post returns the same keys with the post, page builder layouts go to wp_get_builder_layout, and SEO fields go to wp_seo_get. It also states that keys are available only where the account may edit the post and key.

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