Skip to main content
Glama
fav-devs

Sociona MCP Server

by fav-devs

publish_post

Publish a social media post instantly to X, Instagram, or Threads with text content and optional media attachments.

Instructions

Publish a social media post immediately

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
platformYesSocial media platform
contentYesPost content/text
mediaUrlsNoOptional media URLs to attach

Implementation Reference

  • src/index.ts:33-55 (registration)
    Tool name 'publish_post' is registered in the ListToolsRequestSchema handler with its inputSchema defining required parameters (platform, content) and optional mediaUrls.
      name: 'publish_post',
      description: 'Publish a social media post immediately',
      inputSchema: {
        type: 'object',
        properties: {
          platform: {
            type: 'string',
            enum: ['X', 'INSTAGRAM', 'THREADS'],
            description: 'Social media platform',
          },
          content: {
            type: 'string',
            description: 'Post content/text',
          },
          mediaUrls: {
            type: 'array',
            items: { type: 'string' },
            description: 'Optional media URLs to attach',
          },
        },
        required: ['platform', 'content'],
      },
    },
  • The publishPost method executes the tool logic: fetches accounts, finds the matching platform account, and POSTs to /posts API endpoint to publish the post.
    private async publishPost(args: any) {
      const { accounts } = await this.apiRequest('GET', '/accounts');
      const account = accounts.find((a: any) => a.provider === args.platform);
    
      if (!account) {
        throw new Error(`No ${args.platform} account connected. Available accounts: ${accounts.map((a: any) => a.provider).join(', ')}`);
      }
    
      const result = await this.apiRequest('POST', '/posts', {
        accountId: account.id,
        platform: args.platform,
        content: args.content,
        mediaUrls: args.mediaUrls || [],
      });
    
      return {
        content: [
          {
            type: 'text',
            text: `✅ Post published to ${args.platform}!\nStatus: ${result.post.status}\nPost ID: ${result.post.id}`,
          },
        ],
      };
    }
  • The CallToolRequestSchema handler routes the 'publish_post' tool name to the publishPost method.
    case 'publish_post':
      return await this.publishPost(args);
  • Input schema for publish_post defines three properties: platform (enum: X, INSTAGRAM, THREADS), content (string), and mediaUrls (optional array of strings). platform and content are required.
    inputSchema: {
      type: 'object',
      properties: {
        platform: {
          type: 'string',
          enum: ['X', 'INSTAGRAM', 'THREADS'],
          description: 'Social media platform',
        },
        content: {
          type: 'string',
          description: 'Post content/text',
        },
        mediaUrls: {
          type: 'array',
          items: { type: 'string' },
          description: 'Optional media URLs to attach',
        },
      },
      required: ['platform', 'content'],
    },
  • The apiRequest helper is used by publishPost to make authenticated HTTP requests to the Sociona 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 provided, so description carries full burden. It only states the tool publishes immediately but lacks details on authentication, rate limits, failure behavior, or idempotency. Minimal disclosure.

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?

Description is a single sentence that is front-loaded and concise. Every word is purposeful with no wasted text.

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?

No output schema and minimal description. Lacks information about return values, error conditions, or side effects. For a mutation tool, important context is missing.

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 description coverage is 100% (each parameter has a description). Baseline is 3 as per rules; the tool description adds no additional parameter meaning beyond the schema.

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?

Description clearly states the tool publishes a social media post immediately. The verb 'publish' and resource 'social media post' are specific, and the word 'immediately' distinguishes it from sibling schedule_post, which is for future scheduling.

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?

No guidance on when to use this tool versus alternatives. The description does not mention when not to use it or provide context about scheduling versus immediate posting.

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