Skip to main content
Glama
ZLeventer

hubspot-mcp

hs_list_marketing_emails

Retrieve marketing emails from HubSpot with optional filtering by publication state to organize and review drafts, scheduled, published, or archived emails.

Instructions

List marketing emails, optionally filtered by publication state (DRAFT, SCHEDULED, PUBLISHED, ARCHIVED).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
stateNoFilter by publication state

Implementation Reference

  • Zod schema defining input for hs_list_marketing_emails: optional limit (1-100, default 20) and optional state filter (DRAFT, SCHEDULED, PUBLISHED, ARCHIVED).
    export const ListMarketingEmailsSchema = z.object({
      limit: z.number().int().min(1).max(100).default(20).optional(),
      state: z.enum(["DRAFT", "SCHEDULED", "PUBLISHED", "ARCHIVED"]).optional()
        .describe("Filter by publication state"),
    });
  • Handler function listMarketingEmails that calls the HubSpot marketing-emails API with limit, offset, orderBy, and optional state filter, returning the list of marketing emails.
    export async function listMarketingEmails(args: z.infer<typeof ListMarketingEmailsSchema>) {
      const params: Record<string, string | number | boolean> = {
        limit: args.limit ?? 20,
        offset: 0,
        orderBy: "-updatedAt",
      };
      if (args.state) params.state = args.state;
      return hubspot("/marketing-emails/v1/emails", "GET", undefined, params);
    }
  • src/index.ts:48-48 (registration)
    Import of ListMarketingEmailsSchema and listMarketingEmails from ./tools/emails.ts.
    ListMarketingEmailsSchema, listMarketingEmails,
  • src/index.ts:232-237 (registration)
    Registration of the 'hs_list_marketing_emails' tool on the MCP server with its schema and handler wrapper.
    server.tool(
      "hs_list_marketing_emails",
      "List marketing emails, optionally filtered by publication state (DRAFT, SCHEDULED, PUBLISHED, ARCHIVED).",
      ListMarketingEmailsSchema.shape,
      async (args) => { try { return ok(await listMarketingEmails(args)); } catch (e) { return err(e); } },
    );
Behavior2/5

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

With no annotations provided, the description must carry the full burden. It does not disclose any side effects, permissions, or behavioral traits beyond the basic listing operation. The description lacks information on ordering, pagination, or whether the list is exhaustive.

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, front-loaded with the action and resource. It contains no unnecessary words and is easy to parse. Perfect conciseness.

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 list tool with two optional parameters and no output schema, the description is adequate but lacks details like default limit behavior, ordering, and what constitutes a marketing email. It does not reference any output format or pagination, which would be helpful for agents.

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?

The description adds meaning to the 'state' parameter by listing the enum values explicitly, which the schema already includes but with only a brief description. The 'limit' parameter is not explained beyond its schema constraints (integer, range, default). With 50% schema coverage, the description partially compensates for the state parameter but not for limit.

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 'List marketing emails' with optional filtering by state, which distinguishes it from general list tools. However, it does not explicitly differentiate from sibling tools like hs_list_email_campaigns, so a score of 4 is appropriate.

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. There is no mention of prerequisites, context, or comparisons with sibling tools like hs_list_email_campaigns or hs_get_email_campaign_stats.

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/ZLeventer/hubspot-mcp'

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