Skip to main content
Glama
fav-devs

Sociona MCP Server

by fav-devs

cancel_scheduled_post

Cancel a scheduled post before it publishes by providing its post ID.

Instructions

Cancel a scheduled post before it publishes

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
postIdYesThe ID of the scheduled post to cancel

Implementation Reference

  • The implementation of cancelScheduledPost - the handler function that executes the tool logic. It makes a DELETE request to /schedule/{postId} and returns a success or error message.
    private async cancelScheduledPost(args: any) {
      const result = await this.apiRequest('DELETE', `/schedule/${args.postId}`);
    
      if (result.success) {
        return {
          content: [
            {
              type: 'text',
              text: `✅ Scheduled post ${args.postId} has been canceled.`,
            },
          ],
        };
      } else {
        throw new Error(result.message || 'Failed to cancel scheduled post');
      }
    }
  • The tool registration with its input schema. Defines the tool name 'cancel_scheduled_post', its description, and the required 'postId' string parameter.
    name: 'cancel_scheduled_post',
    description: 'Cancel a scheduled post before it publishes',
    inputSchema: {
      type: 'object',
      properties: {
        postId: {
          type: 'string',
          description: 'The ID of the scheduled post to cancel',
        },
      },
      required: ['postId'],
    },
  • src/index.ts:148-149 (registration)
    The switch-case registration that routes the 'cancel_scheduled_post' tool call to the cancelScheduledPost handler method.
    case 'cancel_scheduled_post':
      return await this.cancelScheduledPost(args);
  • The apiRequest helper method used by cancelScheduledPost to make the DELETE HTTP request to the backend API.
    private async apiRequest(method: string, endpoint: string, body?: any) {
      const url = `${API_BASE}${endpoint}`;
      console.error(`Making ${method} request to ${url}`);
    
      const response = await fetch(url, {
        method,
        headers: {
          'Authorization': `Bearer ${SOCIONA_API_KEY}`,
          'Content-Type': 'application/json',
        },
        body: body ? JSON.stringify(body) : undefined,
      });
    
      if (!response.ok) {
        let errorMessage = `API request failed with status ${response.status}`;
        try {
          const errorData = await response.json();
          errorMessage = errorData.message || errorMessage;
        } catch (e) {
          // Ignore JSON parse errors
        }
        throw new Error(errorMessage);
      }
    
      return response.json();
Behavior2/5

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

No annotations are provided; the description only states the action. Does not disclose potential errors (e.g., post already published) or reversibility.

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?

A single, efficient sentence that conveys the essential operation without redundancy.

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?

For a simple tool with one parameter and no output schema, the description is nearly complete. Lacks information on error handling or idempotency.

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?

Schema coverage is 100%; the parameter postId is described in the schema. The description adds no additional semantic value.

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 action 'Cancel' and the resource 'a scheduled post'. It effectively distinguishes from siblings like schedule_post and publish_post.

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?

No explicit when/when-not/alternatives are provided. The description implies use only before publishing, but lacks comparison to siblings.

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/fav-devs/sociona-mcp-server'

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