Skip to main content
Glama
hichana

Goal Story MCP Server

by hichana

goalstory_set_steps_order

Reorder steps in a goal to prioritize tasks or reorganize workflows by specifying the new sequence of step IDs.

Instructions

Reorder steps in a goal by specifying the new sequence. This allows for prioritizing steps or reorganizing the workflow without deleting and recreating steps. IMPORTANT: Steps are ordered by their 'order_ts' timestamp in ascending order - the step with the earliest timestamp becomes step 1, and steps with later timestamps follow in sequence. The system will assign new timestamps based on the array order you provide.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ordered_steps_idsYesArray of step IDs in the desired new order. The first ID in this array will become step 1 (earliest timestamp), the second ID will become step 2, and so on. The array of step IDs *MUST* contain the full set of step ids for the gaol.

Implementation Reference

  • Full handler registration for the 'goalstory_set_steps_order' tool. Converts input ordered_steps_ids to array if needed, POSTs to /steps/order API endpoint to reorder steps by assigning new order_ts timestamps based on array order, and returns formatted response with important notes on ordering.
    server.tool(
      SET_STEPS_ORDER_TOOL.name,
      SET_STEPS_ORDER_TOOL.description,
      SET_STEPS_ORDER_TOOL.inputSchema.shape,
      async (args) => {
        const url = `${GOALSTORY_API_BASE_URL}/steps/order`;
    
        // If ordered_steps_ids comes in as a string (for local development), convert it to array
        let ordered_steps_ids = args.ordered_steps_ids;
        if (typeof ordered_steps_ids === "string") {
          const idsAsString = ordered_steps_ids as string;
          ordered_steps_ids = idsAsString
            .split(",")
            .map((s) => s.trim())
            .filter((s) => s.length > 0);
        }
    
        const body = {
          ordered_steps_ids,
        };
    
        const result = await doRequest(url, "POST", body);
        return {
          content: [
            {
              type: "text",
              text: `Steps order updated:\n${JSON.stringify(result, null, 2)}\n\nIMPORTANT: The first step in the array has the smallest 'order_ts' timestamp (step 1), and each subsequent step has progressively larger timestamps that determine their order in the sequence. Example: If step A has timestamp 12:00 and step B has timestamp 12:01, then step A is step 1 and step B is step 2.`,
            },
          ],
          isError: false,
        };
      },
    );
  • Tool metadata and Zod input schema defining 'ordered_steps_ids' as an array of step ID strings in the desired order.
    export const SET_STEPS_ORDER_TOOL = {
      name: "goalstory_set_steps_order",
      description:
        "Reorder steps in a goal by specifying the new sequence. This allows for prioritizing steps or reorganizing the workflow without deleting and recreating steps. IMPORTANT: Steps are ordered by their 'order_ts' timestamp in ascending order - the step with the earliest timestamp becomes step 1, and steps with later timestamps follow in sequence. The system will assign new timestamps based on the array order you provide.",
      inputSchema: z.object({
        ordered_steps_ids: z
          .array(z.string())
          .describe(
            "Array of step IDs in the desired new order. The first ID in this array will become step 1 (earliest timestamp), the second ID will become step 2, and so on. The array of step IDs *MUST* contain the full set of step ids for the gaol.",
          ),
      }),
    };
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively explains key behavioral traits: it's a mutation tool (implied by 'reorder'), specifies how ordering works (based on 'order_ts' timestamps), and details the system's response (assigns new timestamps based on array order). It also includes an 'IMPORTANT' note about the ordering mechanism, adding valuable context beyond basic functionality.

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 front-loaded with the core purpose in the first sentence, followed by important behavioral details in a structured manner. Every sentence adds value (e.g., explaining the ordering mechanism and system behavior), with no wasted words, making it highly efficient and easy to parse.

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

Completeness4/5

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

Given the tool's complexity (a mutation with specific ordering logic), no annotations, and no output schema, the description does a strong job covering key aspects: purpose, usage, behavioral transparency, and parameter semantics. However, it lacks details on error conditions or response format, which could be useful for completeness, preventing a perfect score.

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?

Schema description coverage is 100%, so the schema already documents the parameter well. The description adds meaningful context by explaining the semantic impact of the parameter ('the first ID becomes step 1, the second step 2, etc.') and reinforces the requirement for a full set of step IDs, which complements the schema without redundancy, earning a score above the baseline of 3.

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 clearly states the specific action ('reorder steps in a goal'), the resource ('steps'), and distinguishes it from siblings by explaining it reorganizes without deletion (unlike destroy_step). It explicitly mentions prioritizing or reorganizing workflow, making the purpose distinct and well-defined.

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

Usage Guidelines4/5

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

The description provides clear context for when to use this tool ('to prioritize steps or reorganize the workflow without deleting and recreating steps'), which helps differentiate it from alternatives like destroy_step or update_step. However, it does not explicitly state when not to use it or name specific sibling tools as alternatives, keeping it from a perfect score.

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