Skip to main content
Glama
elmapicms

elmapicms-mcp-server

Official
by elmapicms

Get Asset

get_asset

Retrieve an asset by its UUID or filename from ElmapiCMS. Use by_name flag to look up by filename instead.

Instructions

Get an asset by its UUID or by filename

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
identifierYesAsset UUID or filename
by_nameNoIf true, looks up by filename instead of UUID

Implementation Reference

  • Registration of the 'get_asset' tool with name, description, input schema (identifier + optional by_name flag), and the async handler function.
    server.registerTool("get_asset", {
      title: "Get Asset",
      description: "Get an asset by its UUID or by filename",
      inputSchema: {
        identifier: z
          .string()
          .describe("Asset UUID or filename"),
        by_name: z
          .boolean()
          .optional()
          .describe("If true, looks up by filename instead of UUID"),
      },
    }, async ({ identifier, by_name }) => {
      const path = by_name
        ? `/files/name/${identifier}`
        : `/files/${identifier}`;
      const result = await client.get(path);
      return {
        content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
      };
    });
  • Handler logic for 'get_asset': constructs the API path based on whether 'by_name' is true (/files/name/:identifier) or false (/files/:identifier), then fetches via client.get and returns the result as JSON text.
    }, async ({ identifier, by_name }) => {
      const path = by_name
        ? `/files/name/${identifier}`
        : `/files/${identifier}`;
      const result = await client.get(path);
      return {
        content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
      };
    });
  • Input schema for 'get_asset' using Zod: 'identifier' (required string for UUID or filename) and 'by_name' (optional boolean flag to switch between UUID and filename lookup).
    inputSchema: {
      identifier: z
        .string()
        .describe("Asset UUID or filename"),
      by_name: z
        .boolean()
        .optional()
        .describe("If true, looks up by filename instead of UUID"),
    },
  • The client.get() method used by the handler to make a GET request to the ElmapiCMS API with optional query parameters.
    async get(
      path: string,
      params?: Record<string, unknown>
    ): Promise<unknown> {
      const url = new URL(`${this.baseUrl}${path}`);
      if (params) {
        const flatPairs = this.flattenParams(params);
        for (const [key, value] of flatPairs) {
          url.searchParams.append(key, value);
        }
      }
    
      const response = await fetch(url.toString(), {
        method: "GET",
        headers: this.headers(),
      });
    
      return this.handleResponse(response);
    }
  • Registration call: registerAssetTools(server, client) which wires the tool into the MCP server.
    registerAssetTools(server, client);
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure, but it only states the basic action. It does not mention read-only nature, authentication requirements, error handling (e.g., asset not found), or response format.

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 a single sentence with no unnecessary words. Every part is essential and front-loaded.

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

Completeness3/5

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

For a simple lookup tool with no output schema, the description is adequate but lacks details on return format, error cases, and what constitutes an 'asset'. Given the low complexity, it meets minimum viability but has gaps.

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 the description adds marginal value by explaining the two lookup methods. However, it does not provide additional details beyond what is already in the schema (e.g., acceptable formats for identifier). 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?

The description clearly states the verb 'Get' and resource 'asset', and specifies the two lookup methods (UUID or filename), which distinguishes it from sibling tools like list_assets.

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

Usage Guidelines3/5

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

The description does not provide explicit guidance on when to use this tool versus alternatives (e.g., list_assets) or how to choose between the two lookup methods. The usage context is implied but not detailed.

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/elmapicms/elmapicms-mcp-server'

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