Skip to main content
Glama

list_merge_fields

Retrieve all merge fields for a Mailchimp audience, including standard fields like FNAME and LNAME and any custom fields you have created.

Instructions

List merge fields (custom fields) for an audience — FNAME, LNAME, plus any custom ones.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
list_idYes
countNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function that executes the 'list_merge_fields' tool logic. It calls the Mailchimp API's /lists/{list_id}/merge-fields endpoint and returns formatted merge field data.
    @mcp.tool()
    async def list_merge_fields(list_id: str, count: int = 50) -> str:
        """List merge fields (custom fields) for an audience — FNAME, LNAME, plus any custom ones."""
        mc = get_client()
        data = await mc.get(
            f"/lists/{list_id}/merge-fields",
            params={"count": min(count, 100)},
        )
        fields = []
        for f in data.get("merge_fields", []):
            fields.append({
                "merge_id": f.get("merge_id", ""),
                "tag": f.get("tag", ""),
                "name": f.get("name", ""),
                "type": f.get("type", ""),
                "required": f.get("required", False),
                "default_value": f.get("default_value", ""),
                "public": f.get("public", False),
            })
        return _fmt({"total_items": data.get("total_items", 0), "merge_fields": fields})
  • The '@mcp.tool()' decorator registers 'list_merge_fields' as an MCP tool.
    @mcp.tool()
  • The function signature defines the input schema: list_id (required string), count (optional int, default 50).
    async def list_merge_fields(list_id: str, count: int = 50) -> str:
        """List merge fields (custom fields) for an audience — FNAME, LNAME, plus any custom ones."""
  • The _fmt helper function formats response data as indented JSON, used by list_merge_fields for output formatting.
    def _fmt(data: Any) -> str:
        """Format response data as indented JSON string."""
        return json.dumps(data, indent=2, default=str)
Behavior2/5

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

No annotations provided. Description only states it lists fields, but does not disclose pagination behavior, rate limits, or required permissions. The count parameter suggests pagination, but not mentioned.

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?

Single, front-loaded sentence. Every word carries meaning, no fluff. Maximum efficiency.

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?

Output schema exists but description fails to mention pagination or count's role. For a list tool, key behaviors like pagination and result structure are omitted. Adequate but incomplete.

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 0%, so description must compensate. It clarifies that list_id corresponds to an audience and hints at merge field names (FNAME, LNAME, custom). However, count parameter is not explained beyond its default.

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 action (list), resource (merge fields), and gives concrete examples (FNAME, LNAME) plus custom ones. It contrasts with sibling tool 'create_merge_field' by being a read operation.

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 like get_member or create_merge_field. Implicitly for exploring existing fields, but no explicit when-to-use or when-not-to-use.

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/AlexlaGuardia/mcp-mailchimp'

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