Skip to main content
Glama
Linked-API
by Linked-API

create_post

Create LinkedIn posts with text and optional media attachments for personal profiles or company pages using the Linked API MCP server.

Instructions

Creates a new LinkedIn post with optional media attachments (st.createPost action).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesPost content, must be up to 3000 characters.
companyUrlNoLinkedIn company page URL. If specified, the post will be created on the company page (requires admin access).
attachmentsNoMedia attachments for the post. You can add up to 9 images, or 1 video, or 1 document. Cannot mix different attachment types.

Implementation Reference

  • The CreatePostTool class that implements the 'create_post' tool. It extends OperationTool, sets the tool name to 'create_post', defines the Zod input schema for validation, provides the MCP tool definition via getTool(), and uses the 'createPost' operation from LinkedAPI.
    export class CreatePostTool extends OperationTool<TCreatePostParams, unknown> {
      public override readonly name = 'create_post';
      public override readonly operationName = OPERATION_NAME.createPost;
      protected override readonly schema = z.object({
        text: z.string().min(1).max(3000),
        companyUrl: z.string().optional(),
        attachments: z
          .array(
            z.object({
              url: z.string(),
              type: z.enum(['image', 'video', 'document']),
              name: z.string().optional(),
            }),
          )
          .max(9)
          .optional(),
      });
    
      public override getTool(): Tool {
        return {
          name: this.name,
          description:
            'Creates a new LinkedIn post with optional media attachments (st.createPost action).',
          inputSchema: {
            type: 'object',
            properties: {
              text: {
                type: 'string',
                description: 'Post content, must be up to 3000 characters.',
              },
              companyUrl: {
                type: 'string',
                description:
                  'LinkedIn company page URL. If specified, the post will be created on the company page (requires admin access).',
              },
              attachments: {
                type: 'array',
                description:
                  'Media attachments for the post. You can add up to 9 images, or 1 video, or 1 document. Cannot mix different attachment types.',
                items: {
                  type: 'object',
                  properties: {
                    url: {
                      type: 'string',
                      description: 'Publicly accessible URL of the media file.',
                    },
                    type: {
                      type: 'string',
                      enum: ['image', 'video', 'document'],
                      description: 'Type of media attachment.',
                    },
                    name: {
                      type: 'string',
                      description: 'Display name for the document (required for documents).',
                    },
                  },
                  required: ['url', 'type'],
                },
              },
            },
            required: ['text'],
          },
        };
      }
    }
  • Zod schema definition for validating the input parameters of the create_post tool: text (required), companyUrl (optional), attachments (optional array).
    protected override readonly schema = z.object({
      text: z.string().min(1).max(3000),
      companyUrl: z.string().optional(),
      attachments: z
        .array(
          z.object({
            url: z.string(),
            type: z.enum(['image', 'video', 'document']),
            name: z.string().optional(),
          }),
        )
        .max(9)
        .optional(),
    });
  • The CreatePostTool is instantiated with a progress callback and added to the array of tools in the LinkedApiTools constructor.
    new CreatePostTool(progressCallback),
  • Import of CreatePostTool from './tools/create-post.js'.
    import { CreatePostTool } from './tools/create-post.js';
  • The execute method in OperationTool base class, which performs the actual tool execution by finding the operation by operationName and calling it with progress tracking.
    export abstract class OperationTool<TParams, TResult> extends LinkedApiTool<TParams, TResult> {
      public abstract readonly operationName: TOperationName;
    
      public override execute({
        linkedapi,
        args,
        workflowTimeout,
        progressToken,
      }: {
        linkedapi: LinkedApi;
        args: TParams;
        workflowTimeout: number;
        progressToken?: string | number;
      }): Promise<TMappedResponse<TResult>> {
        const operation = linkedapi.operations.find(
          (operation) => operation.operationName === this.operationName,
        )! as Operation<TParams, TResult>;
        return executeWithProgress(this.progressCallback, operation, workflowTimeout, {
          params: args,
          progressToken,
        });
      }
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions 'optional media attachments' and references 'st.createPost action', but fails to disclose critical behavioral traits like authentication requirements, rate limits, whether the post is published immediately, error handling, or what happens on success/failure. For a mutation tool with zero annotation coverage, this is insufficient.

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 a single, efficient sentence that front-loads the core purpose. Every word earns its place by specifying the action, target platform, and key optional feature without redundancy or unnecessary elaboration.

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?

For a mutation tool with no annotations and no output schema, the description is incomplete. It doesn't explain what happens after creation (e.g., returns a post ID, confirmation, or error), authentication requirements, or important behavioral constraints. Given the complexity of creating social media posts with media attachments, more context is needed 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?

Schema description coverage is 100%, providing detailed documentation for all parameters. The description adds minimal value beyond the schema, mentioning 'optional media attachments' which is already clear from the schema. It doesn't provide additional context about parameter interactions or usage patterns, so 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 specific action ('Creates a new LinkedIn post') and resource ('LinkedIn post'), including the optional capability for 'media attachments'. It distinguishes from siblings like 'comment_on_post' or 'react_to_post' by focusing on creation rather than interaction with existing posts.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites like authentication, compare with other posting methods, or specify scenarios where this tool is appropriate versus other LinkedIn actions available in the sibling tools list.

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/Linked-API/linkedapi-mcp'

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