Skip to main content
Glama
hdmt
by hdmt

list_emails

Retrieve marketing emails from HubSpot with options to limit results, apply offsets, and sort by date or name for efficient email management.

Instructions

HubSpotのマーケティングメール一覧を取得

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo取得件数(デフォルト: 20)
offsetNoオフセット(デフォルト: 0)
sortNoソート項目 (name, createdAt, updatedAt, createdBy, updatedBy)。降順は -createdAt のように - を付ける

Implementation Reference

  • The core implementation of listEmails method that constructs the HubSpot API request URL with query parameters (limit, offset, sort) and makes the HTTP GET request to /marketing/v3/emails endpoint
    async listEmails(limit = 20, offset = 0, sort?: string) { let url = `/marketing/v3/emails?limit=${limit}&offset=${offset}`; if (sort) { url += `&sort=${encodeURIComponent(sort)}`; } return this.request(url); }
  • Zod schema definition for list_emails tool input validation, defining optional parameters: limit (default 20), offset (default 0), and sort with Japanese description
    export const ListEmailsSchema = z.object({ limit: z.number().optional().default(20), offset: z.number().optional().default(0), sort: z.string().optional().describe('ソート項目 (name, createdAt, updatedAt, createdBy, updatedBy)。降順は -createdAt のように - を付ける'), });
  • src/server.ts:41-51 (registration)
    MCP tool registration for list_emails, defining the tool name, description in Japanese, and input schema with properties for limit, offset, and sort parameters
    name: 'list_emails', description: 'HubSpotのマーケティングメール一覧を取得', inputSchema: { type: 'object', properties: { limit: { type: 'number', description: '取得件数(デフォルト: 20)' }, offset: { type: 'number', description: 'オフセット(デフォルト: 0)' }, sort: { type: 'string', description: 'ソート項目 (name, createdAt, updatedAt, createdBy, updatedBy)。降順は -createdAt のように - を付ける' }, }, }, },
  • MCP request handler for list_emails tool that validates input arguments using ListEmailsSchema, calls the HubSpot client's listEmails method, and returns the formatted JSON response
    case 'list_emails': { const args = ListEmailsSchema.parse(request.params.arguments); const result = await this.hubspot.listEmails(args.limit, args.offset, args.sort); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; }

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

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