Skip to main content
Glama

update_account

Modify account details such as name and other information within the Kapiti platform's user management system.

Instructions

Update account information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoAccount name

Implementation Reference

  • Handler function that executes the update_account tool logic: constructs payload with optional 'name' and sends PUT request to /tools/membership/account endpoint, returns formatted response or error.
    async ({ name }) => {
      try {
        const payload: any = {};
        if (name) payload.name = name;
    
        const response: AxiosResponse<ApiResponse<Account>> = await apiClient.put("/tools/membership/account", payload);
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(response.data, null, 2),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: handleApiError(error),
            },
          ],
          isError: true,
        };
      }
    }
  • Zod input schema defining optional 'name' parameter for the update_account tool.
    inputSchema: {
      name: z.string().optional().describe("Account name"),
    },
  • src/index.ts:548-584 (registration)
    MCP server registration of the 'update_account' tool with title, description, input schema, and inline handler.
    server.registerTool(
      "update_account",
      {
        title: "Update Account",
        description: "Update account information",
        inputSchema: {
          name: z.string().optional().describe("Account name"),
        },
      },
      async ({ name }) => {
        try {
          const payload: any = {};
          if (name) payload.name = name;
    
          const response: AxiosResponse<ApiResponse<Account>> = await apiClient.put("/tools/membership/account", payload);
    
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(response.data, null, 2),
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: handleApiError(error),
              },
            ],
            isError: true,
          };
        }
      }
    );
  • TypeScript interface for Account entity, typed for API responses in update_account tool.
    interface Account {
      id: string;
      name: string;
      description?: string;
      website?: string;
      contactEmail?: string;
      contactPhone?: string;
      createdAt: string;
      updatedAt: string;
    }
  • Helper function used in the tool handler to format and return API error messages.
    function handleApiError(error: any): string {
      if (error.response) {
        return `API Error ${error.response.status}: ${error.response.data?.message || error.response.statusText}`;
      } else if (error.request) {
        return "Network Error: Unable to reach API server";
      } else {
        return `Error: ${error.message}`;
      }
    }

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

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