Skip to main content
Glama
webflow

Webflow

Official
by webflow

Create Reference Field

collection_fields_create_reference

Add reference fields to link items between CMS collections in Webflow. Create connections to organize and relate content across different collections.

Instructions

Create a new reference field in a CMS collection that links to items in another collection.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
collection_idYesUnique identifier for the Collection.
requestYes

Implementation Reference

  • The asynchronous handler function that executes the tool logic: calls WebflowClient.collections.fields.create with collection_id and request, formats the response or error.
    async ({ collection_id, request }) => {
      try {
        const response = await getClient().collections.fields.create(
          collection_id,
          request,
          requestOptions
        );
        return formatResponse(response);
      } catch (error) {
        return formatErrorResponse(error);
      }
    }
  • Zod schema defining the structure for the 'request' parameter used in creating a reference field (ReferenceFieldSchema).
    export const ReferenceFieldSchema = z.object({
      id: z.string().optional().describe("Unique identifier for the Field."),
      isEditable: z
        .boolean()
        .optional()
        .describe("Indicates if the field is editable."),
      isRequired: z
        .boolean()
        .optional()
        .describe("Indicates if the field is required."),
      type: z
        .union([z.literal("MultiReference"), z.literal("Reference")])
        .describe("Type of the field. Choose of these appropriate field types."),
      displayName: z.string().describe("Name of the field."),
      helpText: z.string().optional().describe("Help text for the field."),
      metadata: z
        .object({
          collectionId: z.string(),
        })
        .describe(
          "ID of the referenced collection. Use this only for Reference and MultiReference fields."
        ),
    });
  • Registers the 'collection_fields_create_reference' tool with the MCP server inside registerCmsTools, including title, description, input schema, and handler.
    server.registerTool(
      "collection_fields_create_reference",
      {
        title: "Create Reference Field",
        description:
          "Create a new reference field in a CMS collection that links to items in another collection.",
        inputSchema: z.object({
          collection_id: z
            .string()
            .describe("Unique identifier for the Collection."),
          request: ReferenceFieldSchema,
        }),
      },
      async ({ collection_id, request }) => {
        try {
          const response = await getClient().collections.fields.create(
            collection_id,
            request,
            requestOptions
          );
          return formatResponse(response);
        } catch (error) {
          return formatErrorResponse(error);
        }
      }
    );
Behavior2/5

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

With no annotations provided, the description carries full burden but only states the creation action without behavioral details. It doesn't disclose permissions needed, whether the operation is idempotent, error conditions, or what happens on success/failure, which is inadequate for a mutation tool.

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, efficient sentence that front-loads the core purpose without unnecessary words. Every part earns its place by clearly stating the tool's function.

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?

For a mutation tool with no annotations, no output schema, and incomplete parameter coverage, the description is insufficient. It lacks details on behavioral traits, error handling, and output expectations, making it incomplete for safe and effective use by an AI agent.

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 description coverage is 50%, and the description adds minimal parameter context by mentioning 'links to items in another collection,' which hints at the metadata.collectionId parameter. However, it doesn't explain other parameters like collection_id or request fields, leaving gaps that the schema partially covers.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Create a new reference field') and resource ('in a CMS collection'), specifying it links to another collection. It distinguishes from siblings like 'collection_fields_create_option' or 'collection_fields_create_static' by focusing on reference fields, but doesn't explicitly contrast with them.

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 is provided on when to use this tool versus alternatives. It doesn't mention prerequisites, when not to use it, or refer to sibling tools like 'collection_fields_update' for modifications, leaving the agent to infer usage context.

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

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