Skip to main content
Glama

Read a snippet

wp_get_php_snippet
Read-onlyIdempotent

Read one snippet of Code Snippets or WPCode with its code, by id from wp_list_php_snippets. Returns the fields of the list plus native_location, description, modified, code and declares (the functions and classes the code declares unconditionally); an id the plugin does not have is refused. Raw code access: a snippet may hold API keys or other secrets. Administrators only (manage_options and edit_plugins); not on multisite; blocked by DISALLOW_FILE_EDIT and DISALLOW_FILE_MODS. Forwarded by AlphaBridge Connect to the one site this connection reaches.

Input Schema

NameRequiredDescriptionDefault
idYesSnippet id, as wp_list_php_snippets lists it.
providerNoSnippet plugin: code-snippets (Code Snippets) or wpcode (WPCode). Needed only when both are active.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / id / description
      Previous value: -"Snippet id."New value: +"Snippet id, as wp_list_php_snippets lists it."
  2. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, but the description goes well beyond them: it warns that raw code may contain API keys or other secrets, names the capability gates and blocked constants, clarifies single-site scope and the AlphaBridge forwarding, and enumerates the returned fields since no output schema exists. No contradictions with the read-only annotations.

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

Conciseness4/5

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

Front-loaded with purpose and id source, then prerequisites and return fields; every sentence carries information. The single dense run-on sentence packing the return field list is slightly harder to scan than it needs to be.

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 supplies the return shape (list fields plus native_location, description, modified, code, declares) and defines 'declares', plus access restrictions and failure behavior. Nothing an agent needs to invoke it correctly is missing.

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 coverage is 100% and both parameters are fully documented, including the provider enum and the 'needed only when both are active' condition. The description restates the id provenance rather than adding syntax or format detail, so a baseline 3 is appropriate.

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 ('Read one snippet of Code Snippets or WPCode with its code') and ties it to the sibling listing tool wp_list_php_snippets, which supplies the id. An agent can distinguish it from wp_list_php_snippets and wp_delete_php_snippet without reading the schema.

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?

Explicitly names the source of the id (wp_list_php_snippets), says provider is needed only when both plugins are active, and states the preconditions: administrators only (manage_options and edit_plugins), not on multisite, blocked by DISALLOW_FILE_EDIT and DISALLOW_FILE_MODS. It also states that an unknown id is refused, so failure behavior is anticipated.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources