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'],
    },
Behavior1/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure but offers nothing beyond the basic action. It doesn't indicate whether this is a destructive operation, what permissions might be required, whether changes are reversible, or what happens to unspecified fields. For a mutation tool with zero annotation coverage, this represents a critical gap in understanding the tool's behavior.

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 extremely concise at just two words ('メールを更新'), with zero wasted language. It's front-loaded with the core action and resource. While this conciseness comes at the expense of completeness, the description itself doesn't contain unnecessary verbiage or poor structure.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given this is a mutation tool with 5 parameters (including nested objects), no annotations, and no output schema, the description is completely inadequate. It provides no context about what 'updating' entails, what fields can be modified, what the response looks like, or how this differs from creation operations. The agent would struggle to use this tool correctly without significant trial and error.

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 schema description coverage is 100%, with all 5 parameters documented in the input schema. The description adds no additional parameter information beyond what's already in the structured schema. According to scoring rules, when schema coverage is high (>80%), the baseline score is 3 even with no parameter information in the description.

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

Purpose2/5

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

The description 'メールを更新' (Update email) is a tautology that restates the tool name without providing specific details about what aspects of an email are updated. It doesn't distinguish this tool from sibling tools like create_draft_email or get_email beyond the basic verb. While it identifies the resource (email), it lacks specificity about scope or functionality.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like create_draft_email or get_email. There's no mention of prerequisites, appropriate contexts, or exclusions. The agent receives no help in distinguishing between update operations and creation/retrieval operations.

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

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