Skip to content

Commit 590a2a7

Browse files
Create server.extensions.ts
1 parent a1384c2 commit 590a2a7

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/mcp-server/server.extensions.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { z } from "zod";
2+
import { Register } from "./extensions.js";
3+
import { PromptDefinition } from "./prompts.js";
4+
5+
export function registerMCPExtensions(register: Register): void {
6+
register.prompt(prompt$updateContact);
7+
}
8+
9+
const updateContactArgs = { email: z.string().optional(), phone: z.string().optional(), field_to_update: z.string(), updated_value: z.string() };
10+
export const prompt$updateContact: PromptDefinition<typeof updateContactArgs> = {
11+
name: "update-hubspot-contact-prompt",
12+
description: "update a hubspot contact",
13+
args: updateContactArgs,
14+
prompt: (_client, args, _extra) => ({
15+
messages: [{
16+
role: "user",
17+
content: {
18+
type: "text",
19+
text: `1. Find a hubspot contact based off of either email ${args.email} or phone ${args.phone} depending on what is available to you,
20+
make sure to return the current value of field ${args.field_to_update} and display this value to me.
21+
2. See if the provided value ${args.updated_value} seems reasonable for the field ${args.field_to_update}
22+
3. If the value is reasonable ask the user if they would like to update the contact field ${args.field_to_update} to that value ${args.updated_value}. If yes, update the contact.`
23+
}
24+
}]
25+
})
26+
}

0 commit comments

Comments
 (0)