update-profile
Modify user profile details like name and email to keep account information current and accurate.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "update-profile"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | ||
| No |
Implementation Reference
- server.js:817-854 (handler)Complete implementation of the 'update-profile' MCP tool. Registers the tool with input schema for optional name and email fields. The handler conditionally constructs update data and sends a PUT request to the Terminal.shop /profile endpoint, returning success message with updated profile details or error.
server.tool( "update-profile", { name: z.string().optional(), email: z.string().email().optional(), }, async ({ name, email }) => { try { // Only include fields that are provided const updateData = {}; if (name !== undefined) updateData.name = name; if (email !== undefined) updateData.email = email; const response = await terminalApi.put("/profile", updateData); const profile = response.data.data; return { content: [ { type: "text", text: `Profile updated successfully:\nName: ${profile.user.name}\nEmail: ${profile.user.email}`, }, ], }; } catch (error) { console.error("Error updating profile:", error); return { content: [ { type: "text", text: `Error updating profile: ${error.message}`, }, ], isError: true, }; } }, ); - server.js:819-822 (schema)Input schema for 'update-profile' tool using Zod: optional string for name, optional email validated as email format.
{ name: z.string().optional(), email: z.string().email().optional(), }, - server.js:817-818 (registration)Registration of the 'update-profile' tool on the MCP server.
server.tool( "update-profile",