Skip to main content
Glama
hichana

Goal Story MCP Server

by hichana

goalstory_destroy_scheduled_story

Delete a scheduled story generation configuration by providing its unique identifier. This tool removes automated narrative setups from the goal management system.

Instructions

Delete a scheduled story generation configuration. Use with confirmation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesUnique identifier of the scheduled story configuration to delete.

Implementation Reference

  • MCP tool registration and handler implementation. The async callback function executes the tool logic by making a DELETE HTTP request to the GoalStory API endpoint `/schedules/stories/{id}` using the doRequest helper, and formats the response as MCP tool output.
      DESTROY_SCHEDULED_STORY_TOOL.description,
      DESTROY_SCHEDULED_STORY_TOOL.inputSchema.shape,
      async (args) => {
        const url = `${GOALSTORY_API_BASE_URL}/schedules/stories/${args.id}`;
        const result = await doRequest(url, "DELETE");
        return {
          content: [
            {
              type: "text",
              text: `Scheduled story deleted:\n${JSON.stringify(result, null, 2)}`,
            },
          ],
          isError: false,
        };
      },
    );
    
    // -----------------------------------------
  • Tool definition including name, description, and Zod input schema for validating the 'id' parameter.
    export const DESTROY_SCHEDULED_STORY_TOOL = {
      name: "goalstory_destroy_scheduled_story",
      description:
        "Delete a scheduled story generation configuration. Use with confirmation.",
      inputSchema: z.object({
        id: z
          .string()
          .describe(
            "Unique identifier of the scheduled story configuration to delete.",
          ),
      }),
    };
  • src/index.ts:25-25 (registration)
    Import of the tool definition from tools.ts for use in MCP server registration.
    DESTROY_SCHEDULED_STORY_TOOL,
  • Generic HTTP request helper used by all tool handlers, including this one, to perform API calls with authentication, error handling, and logging.
    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 the destructive nature ('Delete') and adds a caution ('Use with confirmation'), but it lacks details on permissions, reversibility, side effects, or response format. For a mutation 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 two short sentences with zero waste: the first states the purpose, and the second provides a usage note. It is appropriately sized and front-loaded, making it efficient and easy to parse.

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 destructive mutation tool with no annotations and no output schema, the description is incomplete. It should cover more behavioral aspects like confirmation details, error handling, or what happens post-deletion. The current description leaves too many contextual gaps for safe and effective use.

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 input schema has 100% description coverage, with the 'id' parameter fully documented. The description does not add any semantic details beyond what the schema provides (e.g., format examples or constraints), so it meets the baseline of 3 where the schema handles parameter documentation adequately.

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 action ('Delete') and resource ('a scheduled story generation configuration'), which is specific and unambiguous. It distinguishes from siblings like 'goalstory_destroy_goal' or 'goalstory_destroy_step' by specifying the exact resource type, though it doesn't explicitly contrast them.

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 includes 'Use with confirmation,' which implies a cautionary context for this destructive operation, but it doesn't provide explicit guidance on when to use this tool versus alternatives (e.g., vs. 'goalstory_update_scheduled_story' for modifications) or any prerequisites. This leaves usage somewhat implied rather than fully specified.

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