update-profile
Modify user profile details such as name and email on Terminal.shop MCP Server. Ensure accurate and up-to-date information for account management and personalized interactions.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| No | |||
| name | No |
Implementation Reference
- server.js:823-853 (handler)The asynchronous handler function that executes the update-profile tool. It conditionally updates the user's name and/or email by making a PUT request to the /profile endpoint using terminalApi, then returns success or error messages.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)Zod schema defining the input parameters for the update-profile tool: optional 'name' string and optional 'email' string (validated as email).{ name: z.string().optional(), email: z.string().email().optional(), },
- server.js:817-854 (registration)The server.tool() call that registers the 'update-profile' tool, specifying its name, input schema, and handler function.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, }; } }, );