Skip to main content
Glama
jginorio

Sprout Social MCP Server

by jginorio

create_publishing_post

Schedule a future social media post with text and optional media to one or more profiles, adding it to Sprout Social's publishing calendar.

Instructions

Create a new publishing post in Sprout Social to be published at a future time. The post will appear in Sprout's publishing calendar.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
profile_idsYesArray of customer_profile_id values the post will be published to.
textYesThe text content of the post.
scheduled_timeYesISO 8601 datetime when the post should be published (e.g. '2026-06-30T18:00:00Z').
media_idsNoArray of media IDs (from upload_media) to attach to the post.
is_draftNoIf true, creates the post as a draft (default: false).
tagsNoArray of tag IDs to apply to the post.

Implementation Reference

  • src/index.ts:404-457 (registration)
    The server.tool() call that registers the 'create_publishing_post' tool with its name, description, schema, and handler callback.
    server.tool(
      "create_publishing_post",
      "Create a new publishing post in Sprout Social to be published at a future time. " +
        "The post will appear in Sprout's publishing calendar.",
      {
        profile_ids: z
          .array(z.string())
          .describe(
            "Array of customer_profile_id values the post will be published to."
          ),
        text: z.string().describe("The text content of the post."),
        scheduled_time: z
          .string()
          .describe(
            "ISO 8601 datetime when the post should be published (e.g. '2026-06-30T18:00:00Z')."
          ),
        media_ids: z
          .array(z.string())
          .optional()
          .describe(
            "Array of media IDs (from upload_media) to attach to the post."
          ),
        is_draft: z
          .boolean()
          .optional()
          .describe("If true, creates the post as a draft (default: false)."),
        tags: z
          .array(z.string())
          .optional()
          .describe("Array of tag IDs to apply to the post."),
      },
      async ({ profile_ids, text, scheduled_time, media_ids, is_draft, tags }) => {
        const entries = profile_ids.map((profileId) => {
          const entry: Record<string, unknown> = {
            customer_profile_id: profileId,
            text,
            scheduled_time,
            is_draft: is_draft ?? false,
          };
          if (media_ids && media_ids.length > 0) {
            entry.media = media_ids.map((id) => ({ id }));
          }
          if (tags && tags.length > 0) {
            entry.tags = tags;
          }
          return entry;
        });
    
        const data = await sproutRequest("POST", "/publishing/posts", {
          entries,
        });
        return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
      }
    );
  • The handler function that executes the tool logic: maps profile_ids to entries, optionally attaches media and tags, then POSTs to /publishing/posts via sproutRequest.
    async ({ profile_ids, text, scheduled_time, media_ids, is_draft, tags }) => {
      const entries = profile_ids.map((profileId) => {
        const entry: Record<string, unknown> = {
          customer_profile_id: profileId,
          text,
          scheduled_time,
          is_draft: is_draft ?? false,
        };
        if (media_ids && media_ids.length > 0) {
          entry.media = media_ids.map((id) => ({ id }));
        }
        if (tags && tags.length > 0) {
          entry.tags = tags;
        }
        return entry;
      });
    
      const data = await sproutRequest("POST", "/publishing/posts", {
        entries,
      });
      return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
    }
  • Zod schema defining the input parameters: profile_ids (required array of strings), text, scheduled_time, plus optional media_ids, is_draft, tags.
    {
      profile_ids: z
        .array(z.string())
        .describe(
          "Array of customer_profile_id values the post will be published to."
        ),
      text: z.string().describe("The text content of the post."),
      scheduled_time: z
        .string()
        .describe(
          "ISO 8601 datetime when the post should be published (e.g. '2026-06-30T18:00:00Z')."
        ),
      media_ids: z
        .array(z.string())
        .optional()
        .describe(
          "Array of media IDs (from upload_media) to attach to the post."
        ),
      is_draft: z
        .boolean()
        .optional()
        .describe("If true, creates the post as a draft (default: false)."),
      tags: z
        .array(z.string())
        .optional()
        .describe("Array of tag IDs to apply to the post."),
    },
  • The sproutRequest helper function used by the handler to make authenticated HTTP requests to the Sprout Social API.
    async function sproutRequest(
      method: "GET" | "POST",
      path: string,
      body?: Record<string, unknown>
    ): Promise<unknown> {
      const { apiKey, customerId } = getConfig();
      const url = `${SPROUT_API_BASE}/v1/${customerId}${path}`;
    
      const headers: Record<string, string> = {
        Authorization: `Bearer ${apiKey}`,
        Accept: "application/json",
      };
    
      const options: RequestInit = { method, headers };
    
      if (body) {
        headers["Content-Type"] = "application/json";
        options.body = JSON.stringify(body);
      }
    
      const response = await fetch(url, options);
    
      if (!response.ok) {
        const errorText = await response.text();
        throw new Error(
          `Sprout Social API error (${response.status}): ${errorText}`
        );
      }
    
      return response.json();
    }
  • The getConfig helper used to retrieve API key and customer ID from environment variables.
    function getConfig() {
      const apiKey = process.env.SPROUT_SOCIAL_API_KEY;
      if (!apiKey) {
        throw new Error(
          "SPROUT_SOCIAL_API_KEY environment variable is required. " +
            "Set it to your Sprout Social API token."
        );
      }
    
      const customerId = process.env.SPROUT_SOCIAL_CUSTOMER_ID;
      if (!customerId) {
        throw new Error(
          "SPROUT_SOCIAL_CUSTOMER_ID environment variable is required. " +
            "Set it to your Sprout Social customer ID."
        );
      }
    
      return { apiKey, customerId };
    }
Behavior2/5

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

With no annotations, the description carries full burden for behavioral transparency. It mentions 'future time' and 'publishing calendar', but omits critical details such as whether the post can be scheduled immediately, what permissions are needed, rate limits, or the effect of is_draft. The description is too brief to adequately disclose behavioral traits.

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 sentences with no redundant information. Every word adds value, and the core purpose is front-loaded. It is appropriately sized for the tool's complexity.

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 6 parameters, high schema coverage, and no output schema, the description explains the tool's purpose but lacks details about return values, side effects, or error conditions. It is complete enough for basic use but insufficient for robust agent decision-making.

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%, so all six parameters already have explanations. The description adds minimal extra meaning (e.g., 'future time' clarifies scheduled_time), but does not significantly improve understanding beyond the schema. Baseline 3 is appropriate.

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 'Create a new publishing post', specifies the resource 'publishing post in Sprout Social', and adds key context 'to be published at a future time' and 'appear in Sprout's publishing calendar'. It effectively distinguishes from siblings like get_publishing_post (retrieve) and upload_media (upload).

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 is provided on when to use this tool versus alternatives. There is no mention of prerequisites, when not to use it, or comparison to sibling tools like get_publishing_post. The description lacks context for the agent to decide between different publishing or scheduling options.

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/jginorio/sprout-social-mcp'

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