Skip to main content
Glama

retrieve_field_plugin

Retrieve a single field plugin by its numeric ID in a specified context such as space, org, or partner.

Instructions

Retrieves a single field plugin by its ID in the specified context.

Args: field_type_id (int): Numeric ID of the field plugin. context (str): 'space', 'org', or 'partner'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
field_type_idYesNumeric ID of the field plugin
contextNoContext: 'space', 'org', or 'partner'space

Implementation Reference

  • The handler for the 'retrieve_field_plugin' tool. Registered via server.tool(), it accepts field_type_id and context parameters, makes a GET request to the field plugins API endpoint, and returns the JSON response.
      // Tool: retrieve_field_plugin
      server.tool(
        'retrieve_field_plugin',
        `Retrieves a single field plugin by its ID in the specified context.
    
    Args:
        field_type_id (int): Numeric ID of the field plugin.
        context (str): 'space', 'org', or 'partner'.`,
        {
          field_type_id: z.number().describe('Numeric ID of the field plugin'),
          context: z.enum(['space', 'org', 'partner']).default('space').describe("Context: 'space', 'org', or 'partner'"),
        },
        async ({ field_type_id, context }) => {
          try {
            const url = `${FIELD_PLUGIN_URLS[context]}/${field_type_id}`;
            const response = await fetch(url, {
              method: 'GET',
              headers: getManagementHeaders(),
            });
            const data = await handleResponse(response, url);
            return createJsonResponse(data);
          } catch (error) {
            if (error instanceof APIError) {
              return createErrorResponse(error);
            }
            throw error;
          }
        }
      );
  • Zod schema for the 'retrieve_field_plugin' tool: field_type_id (number, required) and context (enum: space/org/partner, default: 'space').
    {
      field_type_id: z.number().describe('Numeric ID of the field plugin'),
      context: z.enum(['space', 'org', 'partner']).default('space').describe("Context: 'space', 'org', or 'partner'"),
    },
  • Registration of the 'retrieve_field_plugin' tool via server.tool() inside the registerFieldPlugins function.
      server.tool(
        'retrieve_field_plugin',
        `Retrieves a single field plugin by its ID in the specified context.
    
    Args:
        field_type_id (int): Numeric ID of the field plugin.
        context (str): 'space', 'org', or 'partner'.`,
        {
          field_type_id: z.number().describe('Numeric ID of the field plugin'),
          context: z.enum(['space', 'org', 'partner']).default('space').describe("Context: 'space', 'org', or 'partner'"),
        },
        async ({ field_type_id, context }) => {
          try {
            const url = `${FIELD_PLUGIN_URLS[context]}/${field_type_id}`;
            const response = await fetch(url, {
              method: 'GET',
              headers: getManagementHeaders(),
            });
            const data = await handleResponse(response, url);
            return createJsonResponse(data);
          } catch (error) {
            if (error instanceof APIError) {
              return createErrorResponse(error);
            }
            throw error;
          }
        }
      );
  • Import of registerFieldPlugins from field-plugins.js, called at line 103 to register all field plugin tools (including retrieve_field_plugin).
    import { registerFieldPlugins } from './field-plugins.js';
    
    /**
     * Registers all tools with the MCP server
     */
    export function registerAllTools(server: McpServer): void {
      // Simple tools
      registerPing(server);
      registerMeta(server);
    
      // Tag management
      registerTags(server);
      registerInternalTags(server);
    
      // Access and authentication
      registerAccessTokens(server);
    
      // Activity tracking
      registerActivities(server);
    
      // Workflow management
      registerApprovals(server);
      registerWorkflows(server);
      registerWorkflowStages(server);
      registerWorkflowStageChanges(server);
    
      // Branch/Pipeline management
      registerBranches(server);
      registerBranchDeployments(server);
    
      // User management
      registerCollaborators(server);
      registerSpaceRoles(server);
    
      // Data sources
      registerDatasources(server);
      registerDatasourceEntries(server);
    
      // Content management
      registerPresets(server);
      registerReleases(server);
      registerSchedulingStories(server);
      registerTasks(server);
    
      // Space management
      registerSpace(server);
    
      // Webhooks
      registerWebhooks(server);
    
      // Components
      registerComponents(server);
      registerComponentsFolder(server);
    
      // Assets
      registerAssets(server);
      registerAssetsFolders(server);
    
      // Stories (most complex)
      registerStories(server);
    
      // Discussions
      registerDiscussions(server);
    
      // Extensions and plugins
      registerExtensions(server);
      registerFieldPlugins(server);
  • getManagementHeaders() helper used by the handler to construct Authorization and Content-Type headers for the API request.
    export function getManagementHeaders(): Record<string, string> {
      return {
        Authorization: cfg.managementToken,
        'Content-Type': 'application/json',
      };
    }
Behavior2/5

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

No annotations are provided, and the description does not disclose behavioral traits such as read-only nature, required permissions, or rate limits. As a retrieval tool, it likely has no side effects, but this is not stated.

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 extremely concise, using a single sentence plus a bullet list of arguments. No unnecessary words.

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

Completeness2/5

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

There is no output schema, and the description does not explain the return value or structure of the retrieved field plugin. For a retrieval tool, this omission reduces completeness.

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%, so the description adds minimal value beyond the schema. It restates parameter names and types but does not provide additional semantics like formatting or constraints not already in 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 clearly states the verb 'Retrieves' and the resource 'a single field plugin by its ID', distinguishing it from siblings like 'retrieve_field_plugins' (plural) and other field plugin tools.

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?

It implies usage for retrieving a specific field plugin via ID and context, but does not explicitly mention when not to use or alternatives like the plural variant 'retrieve_field_plugins'.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hypescale/storyblok-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server