Skip to main content
Glama

Find content by slug

get_content_by_slug
Read-only

Retrieve WordPress content by slug across all content types at once, or narrow by specific types. Use when you know the URL tail but not the owning post type.

Instructions

Look up content by slug across every content type at once, or within specific types. Use when you know the URL tail but not which post type owns it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
slugYesThe slug, i.e. the last path segment of the URL.
typesNoRestrict to these content types. Defaults to every REST-exposed content type.
site_idNoWhich configured WordPress site to act on. Optional — with a single site configured it is used automatically; with several, the default site is used unless you name one. Run list_sites for valid ids.
include_contentNoInclude full bodies in the results.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv2.0.0
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / slug / minLength
      Added value: +1
    • changedInput schema / properties / types / description
      Previous value: -"Restrict to these content types. Defaults to every REST-exposed type."New value: +"Restrict to these content types. Defaults to every REST-exposed content type."
  2. First observedv1.0.0

TDQS

A4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, and openWorldHint=true, covering the safety profile. The description adds useful context about cross-content-type lookup and URL-tail semantics, but does not disclose result shape or potential limitations. With annotations present, this is adequate but not rich.

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 two tight sentences: the first states the operation and scope, the second states the precise condition for use. There is no wasted text and the key information is front-loaded.

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

Completeness4/5

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

For a read-only lookup tool with fully documented parameters, clear use-case guidance, and safety annotations, the description is nearly complete. The only minor gap is that it does not explicitly describe what the response contains, and there is no output schema to fill that gap.

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

Parameters3/5

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

Schema description coverage is 100%, with all four parameters documented including defaults and semantics. The description adds no additional parameter-level meaning, but none is needed because the schema already carries the full burden.

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 operation—look up content by slug—and precisely scopes it: across every content type at once or restricted to specific types. It also clarifies the distinguishing use case (knowing the URL tail but not the owning post type), which separates it from URL-based or single-type content lookups among the siblings.

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?

The description gives a clear when-to-use instruction: use when you know the URL tail but not which post type owns it. It does not explicitly name alternatives such as find_content_by_url or get_content, but the context is sufficient for an agent to select this tool for slug-based lookup.

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