Skip to main content
Glama
hichana

Goal Story MCP Server

by hichana

goalstory_update_self_user

Update your Goal Story profile by modifying your name, visibility settings, and personal context through guided questions about motivations and goal-achievement preferences.

Instructions

Update the user's profile including their name, visibility preferences, and personal context. When updating 'about' data, guide the user through questions to understand their motivations, beliefs, and goal-achievement style.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoThe user's preferred name for their Goal Story profile.
aboutNoPersonal context including motivations, beliefs, and goal-achievement preferences gathered through guided questions.
visibilityNoProfile visibility setting where 0 = public (viewable by others) and 1 = private (only visible to user).

Implementation Reference

  • The handler function for 'goalstory_update_self_user' tool. It makes a PATCH request to the /users API endpoint with the provided args (name, about, visibility), using the shared doRequest helper, and returns the result as MCP content.
    async (args) => {
      const url = `${GOALSTORY_API_BASE_URL}/users`;
      const body = {
        ...(args.name ? { name: args.name } : {}),
        ...(args.about ? { about: args.about } : {}),
        ...(typeof args.visibility === "number"
          ? {
              visibility: args.visibility,
            }
          : {}),
      };
      const result = await doRequest(url, "PATCH", body);
      return {
        content: [
          {
            type: "text",
            text: `Updated user:\n${JSON.stringify(result, null, 2)}`,
          },
        ],
        isError: false,
      };
    },
  • src/index.ts:191-217 (registration)
    Registers the 'goalstory_update_self_user' tool with the MCP server using server.tool(), providing name, description, input schema shape from tools.ts, and the handler function.
    server.tool(
      UPDATE_SELF_USER_TOOL.name,
      UPDATE_SELF_USER_TOOL.description,
      UPDATE_SELF_USER_TOOL.inputSchema.shape,
      async (args) => {
        const url = `${GOALSTORY_API_BASE_URL}/users`;
        const body = {
          ...(args.name ? { name: args.name } : {}),
          ...(args.about ? { about: args.about } : {}),
          ...(typeof args.visibility === "number"
            ? {
                visibility: args.visibility,
              }
            : {}),
        };
        const result = await doRequest(url, "PATCH", body);
        return {
          content: [
            {
              type: "text",
              text: `Updated user:\n${JSON.stringify(result, null, 2)}`,
            },
          ],
          isError: false,
        };
      },
    );
  • Defines the tool object with name, description, and Zod inputSchema used for registration and validation in the MCP server.
    export const UPDATE_SELF_USER_TOOL = {
      name: "goalstory_update_self_user",
      description:
        "Update the user's profile including their name, visibility preferences, and personal context. When updating 'about' data, guide the user through questions to understand their motivations, beliefs, and goal-achievement style.",
      inputSchema: z.object({
        name: z
          .string()
          .optional()
          .describe("The user's preferred name for their Goal Story profile."),
        about: z
          .string()
          .optional()
          .describe(
            "Personal context including motivations, beliefs, and goal-achievement preferences gathered through guided questions.",
          ),
        visibility: z
          .number()
          .optional()
          .describe(
            "Profile visibility setting where 0 = public (viewable by others) and 1 = private (only visible to user).",
          ),
      }),
    };
  • TypeScript interface defining the input shape for the tool, matching the Zod schema.
    export interface GoalstoryUpdateSelfUserInput {
      name?: string;
      about?: string;
      visibility?: number; // 0=public, 1=private
    }
  • Shared helper function used by all tool handlers to make authenticated HTTP requests to the GoalStory API, with comprehensive error handling.
    async function doRequest<T = any>(
      url: string,
      method: string,
      body?: unknown,
    ): Promise<T> {
      console.error("Making request to:", url);
      console.error("Method:", method);
      console.error("Body:", body ? JSON.stringify(body) : "none");
    
      try {
        const response = await axios({
          url,
          method,
          headers: {
            "Content-Type": "application/json",
            Authorization: `Bearer ${GOALSTORY_API_TOKEN}`,
          },
          data: body,
          timeout: 10000, // 10 second timeout
          validateStatus: function (status) {
            return status >= 200 && status < 500; // Accept all status codes less than 500
          },
        });
        console.error("Response received:", response.status);
        return response.data as T;
      } catch (err) {
        console.error("Request failed with error:", err);
    
        if (axios.isAxiosError(err)) {
          if (err.code === "ECONNABORTED") {
            throw new Error(
              `Request timed out after 10 seconds. URL: ${url}, Method: ${method}`,
            );
          }
          if (err.response) {
            // The request was made and the server responded with a status code
            // that falls out of the range of 2xx
            throw new Error(
              `HTTP Error ${
                err.response.status
              }. URL: ${url}, Method: ${method}, Body: ${JSON.stringify(
                body,
              )}. Error text: ${JSON.stringify(err.response.data)}`,
            );
          } else if (err.request) {
            // The request was made but no response was received
            throw new Error(
              `No response received from server. URL: ${url}, Method: ${method}`,
            );
          } else {
            // Something happened in setting up the request that triggered an Error
            throw new Error(`Request setup failed: ${err.message}`);
          }
        } else {
          // Something else happened
          throw new Error(
            `Unexpected error: ${err instanceof Error ? err.message : String(err)}`,
          );
        }
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions that updating 'about' data involves guiding the user through questions, which adds some context about the interactive nature of that parameter. However, it lacks details on permissions required, whether changes are reversible, error handling, or response format. For a mutation tool with zero annotation coverage, this is insufficient.

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 concise and well-structured in two sentences. The first sentence front-loads the core purpose, and the second adds specific guidance for one parameter. There's no unnecessary repetition or fluff, making it efficient.

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 that this is a mutation tool with no annotations and no output schema, the description is incomplete. It doesn't cover behavioral aspects like authentication needs, side effects, or what the tool returns. The parameter guidance is minimal, and there's no mention of sibling tools or error conditions, leaving significant gaps for an AI agent.

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?

The schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds minimal value beyond the schema: it implies that 'about' involves guided questions for gathering motivations and beliefs, which slightly elaborates on the schema's description. However, it doesn't provide additional syntax, format, or constraints for any parameters.

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

Purpose4/5

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

The description clearly states the tool's purpose: updating the user's profile with specific fields (name, visibility preferences, personal context). It uses specific verbs ('update', 'guide') and identifies the resource ('user's profile'). However, it doesn't explicitly differentiate from sibling tools like 'goalstory_update_goal' or 'goalstory_update_step', which also perform updates on different resources.

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?

The description provides minimal usage guidance. It mentions that updating 'about' data involves guiding the user through questions, but it doesn't specify when to use this tool versus alternatives (e.g., 'goalstory_read_self_user' for reading the profile or other update tools for different resources). No explicit when-not-to-use or prerequisite information is included.

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/hichana/goalstory-mcp'

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