Skip to main content
Glama
hichana

Goal Story MCP Server

by hichana

goalstory_read_current_focus

Retrieve the user's current active goal and step to maintain context during discussions and story creation.

Instructions

Identify which goal and step the user is currently focused on to maintain context in discussions and story creation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'goalstory_read_current_focus' tool. It makes a GET request to the '/current' API endpoint using the shared doRequest helper and formats the response as text content.
    async (args) => {
      const url = `${GOALSTORY_API_BASE_URL}/current`;
      const result = await doRequest(url, "GET");
      return {
        content: [
          {
            type: "text",
            text: `Current goal/step focus:\n${JSON.stringify(result, null, 2)}`,
          },
        ],
        isError: false,
      };
    },
  • src/index.ts:397-414 (registration)
    Registers the 'goalstory_read_current_focus' tool on the MCP server using the tool specification imported from tools.ts, with an inline handler implementation.
    server.tool(
      READ_CURRENT_FOCUS_TOOL.name,
      READ_CURRENT_FOCUS_TOOL.description,
      READ_CURRENT_FOCUS_TOOL.inputSchema.shape,
      async (args) => {
        const url = `${GOALSTORY_API_BASE_URL}/current`;
        const result = await doRequest(url, "GET");
        return {
          content: [
            {
              type: "text",
              text: `Current goal/step focus:\n${JSON.stringify(result, null, 2)}`,
            },
          ],
          isError: false,
        };
      },
    );
  • Defines the tool specification including name, description, and empty input schema (z.object({})) for 'goalstory_read_current_focus'.
    /**
     * GET /current
     */
    export const READ_CURRENT_FOCUS_TOOL = {
      name: "goalstory_read_current_focus",
      description:
        "Identify which goal and step the user is currently focused on to maintain context in discussions and story creation.",
      inputSchema: z.object({}),
    };
  • TypeScript interface for the tool's input, which is empty.
    export interface GoalstoryReadCurrentFocusInput {}
  • Shared helper function used by all tools (including this one) to make authenticated HTTP requests to the GoalStory API.
    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 describes the tool's function but lacks details about behavioral traits: it doesn't mention whether this is a read-only operation (implied by 'identify' but not explicit), what permissions are required, how it determines 'current focus' (e.g., from user session or last interaction), or potential rate limits. For a tool with zero annotation coverage, this is a significant gap in transparency.

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

Conciseness5/5

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

The description is a single, well-structured sentence that efficiently conveys the tool's purpose and usage context. It's front-loaded with the core function ('Identify which goal and step...') and follows with the rationale ('to maintain context...'). Every word earns its place, with no redundancy or unnecessary elaboration.

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

Completeness3/5

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

Given the tool's complexity (simple read operation with 0 parameters) and the absence of annotations and output schema, the description is minimally adequate. It explains what the tool does but lacks details about behavioral aspects (e.g., how 'current focus' is determined) and output format. For a tool with no structured data to rely on, the description should provide more context to be fully complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters, and schema description coverage is 100% (since there are no parameters to describe). The description doesn't need to add parameter semantics, so it naturally meets the baseline. No additional parameter information is required or provided.

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: 'Identify which goal and step the user is currently focused on.' It specifies the verb ('identify') and resource ('goal and step'), making it easy to understand what the tool does. However, it doesn't explicitly differentiate from siblings like 'goalstory_read_one_goal' or 'goalstory_read_one_step', which might retrieve specific goals/steps rather than the current focus.

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

Usage Guidelines3/5

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

The description provides implied usage context: 'to maintain context in discussions and story creation.' This suggests it should be used when the agent needs to understand the user's current focus for conversational or creative tasks. However, it doesn't explicitly state when to use this tool versus alternatives like 'goalstory_read_goals' (which lists all goals) or 'goalstory_get_story_context' (which might provide broader context). No explicit exclusions or comparisons are provided.

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