Skip to main content
Glama
hdmt
by hdmt

update_email

Modify existing HubSpot marketing emails by updating campaign names, subject lines, HTML content, or structured content elements to refine email campaigns.

Instructions

メールを更新

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
emailIdYesメールID
nameNoキャンペーン名
subjectNoメール件名
htmlBodyNoHTML本文(シンプルなメール用)
contentNoメールコンテンツ構造(flexAreas, widgets等を含む詳細設定)

Implementation Reference

  • The main handler for update_email tool that parses arguments, constructs update data object, and calls the HubSpot client's updateEmail method. It optionally includes name, subject, htmlBody, and content fields based on provided arguments.
    case 'update_email': { const args = UpdateEmailSchema.parse(request.params.arguments); const updateData: any = {}; if (args.name) updateData.name = args.name; if (args.subject) updateData.subject = args.subject; if (args.htmlBody) updateData.emailBody = args.htmlBody; if (args.content) updateData.content = args.content; const result = await this.hubspot.updateEmail(args.emailId, updateData); return { content: [ { type: 'text', text: `✅ メールを更新しました\n${JSON.stringify(result, null, 2)}` }, ], }; }
  • The actual implementation in HubSpotClient that makes a PATCH request to the HubSpot Marketing API endpoint '/marketing/v3/emails/{emailId}' to update an email with the provided data.
    async updateEmail(emailId: string, data: any) { return this.request(`/marketing/v3/emails/${emailId}`, { method: 'PATCH', body: JSON.stringify(data), }); }
  • The Zod schema definition for UpdateEmailSchema that validates input parameters: emailId (required string), name (optional string), subject (optional string), htmlBody (optional string), and content (optional any).
    export const UpdateEmailSchema = z.object({ emailId: z.string(), name: z.string().optional(), subject: z.string().optional(), htmlBody: z.string().optional().describe('HTMLメール本文(シンプルなメール用)'), content: z.any().optional().describe('メールコンテンツ構造(flexAreas, widgets等を含む詳細設定)'), });
  • src/server.ts:81-93 (registration)
    Tool registration in the MCP server that defines the update_email tool with its description, input schema properties (emailId, name, subject, htmlBody, content), and required fields (emailId).
    name: 'update_email', description: 'メールを更新', inputSchema: { type: 'object', properties: { emailId: { type: 'string', description: 'メールID' }, name: { type: 'string', description: 'キャンペーン名' }, subject: { type: 'string', description: 'メール件名' }, htmlBody: { type: 'string', description: 'HTML本文(シンプルなメール用)' }, content: { type: 'object', description: 'メールコンテンツ構造(flexAreas, widgets等を含む詳細設定)' }, }, required: ['emailId'], },

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