Skip to main content
Glama

get_collection

Retrieve the complete schema of a collection, including its fields, types, and relations, to understand data structure.

Instructions

Récupère le schéma complet d'une collection (champs, types, relations)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
collectionYesNom de la collection

Implementation Reference

  • Schema definition for the get_collection tool: takes a required 'collection' (string) parameter, returns the collection's full schema (fields, types, relations).
    {
      name: "get_collection",
      description: "Récupère le schéma complet d'une collection (champs, types, relations)",
      inputSchema: {
        type: "object",
        properties: {
          collection: {
            type: "string",
            description: "Nom de la collection",
          },
        },
        required: ["collection"],
      },
    },
  • Handler that extracts the 'collection' argument from the request and calls skema.getCollection() to fetch the collection schema.
    case "get_collection": {
      const { collection } = args as { collection: string };
      result = await skema.getCollection(collection);
      break;
    }
  • Helper function getCollection() that makes a JSON-RPC call with tool name 'get_collection' and the collection argument to the remote Skema API.
    /**
     * Recupere le schema d'une collection
     */
    export const getCollection = (collection: string) =>
      mcpCall("get_collection", { collection });
  • Generic mcpCall function used by getCollection to communicate with the Skema CMS MCP API via HTTP JSON-RPC.
    export const mcpCall = async <T = unknown>(
      toolName: string,
      args: Record<string, unknown> = {}
    ): Promise<T> => {
      requestId++;
    
      const response = await fetch(`${BASE_URL}/mcp`, {
        method: "POST",
        headers: {
          "X-API-Key": API_KEY,
          "Content-Type": "application/json",
        },
        body: JSON.stringify({
          jsonrpc: "2.0",
          id: requestId,
          method: "tools/call",
          params: {
            name: toolName,
            arguments: args,
          },
        }),
      });
    
      if (!response.ok) {
        const error = await response
          .json()
          .catch(() => ({ message: "Erreur inconnue" }));
        throw new Error(error.message || `Erreur HTTP ${response.status}`);
      }
    
      const jsonRpc: JsonRpcResponse<T> = await response.json();
    
      if (jsonRpc.error) {
        throw new Error(jsonRpc.error.message);
      }
    
      if (!jsonRpc.result?.content?.[0]?.text) {
        throw new Error("Reponse MCP invalide");
      }
    
      return JSON.parse(jsonRpc.result.content[0].text);
    };
Behavior2/5

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

No annotations are provided, so the description must disclose behavioral traits. It only describes the function (retrieving schema) but does not mention that it is a read-only operation, whether it requires authentication, or any side effects. The description is insufficient for an agent to understand behavioral implications.

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 filler, front-loading the key action and what is returned. Every word is necessary and relevant.

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 simple tool with one parameter and no output schema, the description adequately explains the return value (fields, types, relations). It could be more precise about what 'complete schema' entails, but it is sufficient for most use cases. Missing output schema is not penalized as per rules.

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% (parameter described as 'Nom de la collection'). The description adds the context that the parameter is the collection whose schema is retrieved, but the schema already indicates it's a collection name. No additional parameter details like format or constraints are provided, so it meets the baseline for high coverage.

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 it retrieves the complete schema of a collection, specifying it includes fields, types, and relations. This distinguishes it from siblings like get_collections (which lists collections) and get_collection_item (which retrieves an item).

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus alternatives. It does not mention prerequisites, when not to use it, or suggest siblings like get_collection_item for item retrieval. The purpose is implied but not explicit.

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

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