Skip to main content
Glama

Update Profile

update_profile

Modify your display name or avatar URL to update your profile information.

Instructions

Update current user's profile information.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoDisplay name
avatarUrlNoAvatar URL

Implementation Reference

  • The updateProfileHandler function (lines 8-30) executes the tool logic by constructing a GraphQL mutation to update the user profile, calling the GraphQL client, and returning the result. The tool is registered via server.registerTool on line 31-42 with name 'update_profile', Zod schema for 'name' and 'avatarUrl' inputs, and the handler.
    export function registerUserCRUDTools(server: McpServer, gql: GraphQLClient) {
      // UPDATE PROFILE
      const updateProfileHandler = async ({ name, avatarUrl }: { name?: string; avatarUrl?: string }) => {
        try {
          const mutation = `
            mutation UpdateProfile($input: UpdateUserInput!) {
              updateProfile(input: $input) {
                id
                name
                avatarUrl
                email
              }
            }
          `;
          
          const input: any = {};
          if (name !== undefined) input.name = name;
          if (avatarUrl !== undefined) input.avatarUrl = avatarUrl;
          
          const data = await gql.request<{ updateProfile: any }>(mutation, { input });
          return text(data.updateProfile);
        } catch (error: any) {
          return text({ error: error.message });
        }
      };
      server.registerTool(
        "update_profile",
        {
          title: "Update Profile",
          description: "Update current user's profile information.",
          inputSchema: {
            name: z.string().optional().describe("Display name"),
            avatarUrl: z.string().optional().describe("Avatar URL")
          }
        },
        updateProfileHandler as any
      );
  • Registers the tool 'update_profile' on the MCP server with its title, description, input schema (name and avatarUrl as optional strings), and the updateProfileHandler function.
    server.registerTool(
      "update_profile",
      {
        title: "Update Profile",
        description: "Update current user's profile information.",
        inputSchema: {
          name: z.string().optional().describe("Display name"),
          avatarUrl: z.string().optional().describe("Avatar URL")
        }
      },
      updateProfileHandler as any
    );
  • The input schema definition for the tool, specifying name (optional string, 'Display name') and avatarUrl (optional string, 'Avatar URL') via Zod.
    "update_profile",
    {
      title: "Update Profile",
      description: "Update current user's profile information.",
      inputSchema: {
        name: z.string().optional().describe("Display name"),
        avatarUrl: z.string().optional().describe("Avatar URL")
      }
  • Imports: McpServer from SDK, z from zod for schema validation, GraphQLClient for API calls, and the text helper from util/mcp.ts which formats responses as MCP text content.
    import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
    import { z } from "zod";
    import { GraphQLClient } from "../graphqlClient.js";
    import { text } from "../util/mcp.js";
  • src/index.ts:11-11 (registration)
    Imports registerUserCRUDTools from userCRUD.ts, which is called on line 185 to register the update_profile tool on the server during startup.
    import { registerUserCRUDTools } from "./tools/userCRUD.js";
Behavior2/5

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

No annotations are provided, so the description must convey behavioral traits. It states 'Update' implying a mutation operation, but provides no details on side effects, authentication requirements, or what happens if no fields are provided. It lacks transparency for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, concise sentence with no unnecessary words. While it could include more detail, it is appropriately sized for a simple tool.

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

Completeness2/5

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

Given two parameters, no output schema, and no annotations, the description is minimal. It does not explain update semantics (partial vs full update), return value, or error conditions. For a mutation tool, more context is needed.

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?

Input schema coverage is 100% with clear descriptions for 'name' and 'avatarUrl'. The description adds no additional meaning beyond 'profile information', which is already implied by the parameter context. Baseline 3 is appropriate.

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

Purpose5/5

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

The description 'Update current user's profile information' uses a specific verb ('update') and resource ('current user's profile'), clearly distinguishing it from other update tools that target different resources (e.g., collections, comments).

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives like 'update_settings' or other update tools. The description does not specify that this is only for the currently authenticated user or mention prerequisites (e.g., authentication required).

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/DAWNCR0W/affine-mcp-server'

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