Skip to main content
Glama

Get global styles

get_global_styles
Read-only

Fetch a block theme's design tokens—palette, typography, spacing, per-block styles—from theme.json and Site Editor customizations.

Instructions

Read a block theme's global styles — the palette, typography, spacing and per-block styling that theme.json defines and the Site Editor overrides. This is where a block theme's design tokens live.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
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_theme_defaultsNoAlso return the theme's own theme.json settings and styles, which the user customisations layer on top of. The user record alone only holds what was changed in the Site Editor, so it is often nearly empty. Verbose.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 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 / include_theme_defaults
      Added value: +{
      +  "default": false,
      +  "description": "Also return the theme's own theme.json settings and styles, which the user customisations layer on top of. The user record alone only holds what was changed in the Site Editor, so it is often nearly empty. Verbose.",
      +  "type": "boolean"
      +}
  2. First observedv1.0.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so the safety profile is covered. The description adds behavioral context: it explains that the user record alone may be nearly empty because it only holds Site Editor changes, and that include_theme_defaults is verbose. This helps the agent understand the data shape and the cost of the verbose option. It doesn't mention pagination or response format, but for a read-only getter with no output schema, this is adequate.

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?

Two sentences, front-loaded with the core purpose, then a clarifying elaboration. Every sentence earns its place. The second sentence reinforces the resource scope without padding. No fluff, no repetition of schema details.

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 getter with 2 optional parameters, 100% schema coverage, and no output schema, the description is nearly complete. It explains what the tool returns (global styles/design tokens), the key nuance about user customisations vs theme defaults, and the verbosity of include_theme_defaults. It could mention that the result is JSON or that it returns the full global stylesheet, but the description is sufficient for an agent to call it correctly.

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 description coverage is 100%, so the schema already documents both parameters well. The description adds value by explaining the conceptual relationship between the user customisations and theme defaults, which clarifies why include_theme_defaults exists and when it matters. It doesn't repeat parameter names but enriches the mental model. Baseline 3 is exceeded because the description adds meaningful context beyond the schema.

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 ('Read') and resource ('a block theme's global styles'), and elaborates on what that includes: palette, typography, spacing, and per-block styling. It also distinguishes this from a generic 'get styles' by noting it covers theme.json definitions and Site Editor overrides, which helps differentiate it from siblings like get_theme, get_theme_mods, and update_global_styles.

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 implies when to use this tool: when you need design tokens/global styles from a block theme. It doesn't explicitly name alternatives or exclusions, but the context of 'block theme' and 'design tokens' gives clear usage context. It could be improved by explicitly saying 'use get_theme for theme metadata' or 'use get_theme_mods for classic theme settings', but the current wording is sufficient for an agent to select it correctly.

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