Skip to main content
Glama
ahmedselimmansor-ctrl

LinkedIn MCP Server

create_text_post

Post a text-only update to your LinkedIn feed to share thoughts or updates with your network.

Instructions

Share a simple text update on the user's feed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesThe text content of the post.

Implementation Reference

  • The handler function that executes the 'create_text_post' tool logic. It validates the 'text' argument, calls getMyUrn() to get the user's LinkedIn URN, then calls client.createTextPost() to publish the post.
    export async function handleContentTool(name: string, args: any, client: LinkedInClient) {
      switch (name) {
        case "create_text_post": {
          if (!args || !args.text) {
            throw new McpError(ErrorCode.InvalidParams, "text is required");
          }
          const urn = await client.getMyUrn();
          const result = await client.createTextPost(urn, args.text);
          return {
            content: [
              {
                type: "text",
                text: `Post created successfully: ${JSON.stringify(result, null, 2)}`,
              },
            ],
          };
        }
  • The tool definition including name, description, and inputSchema for 'create_text_post'. Defines 'text' as a required string parameter.
    export const contentTools = [
      {
        name: "create_text_post",
        description: "Share a simple text update on the user's feed.",
        inputSchema: {
          type: "object",
          properties: {
            text: {
              type: "string",
              description: "The text content of the post.",
            },
          },
          required: ["text"],
        },
      },
  • The LinkedIn client method that actually calls the LinkedIn API to create a text post. Builds the UGC post payload with author, lifecycleState, shareCommentary, and visibility, then POSTs to /ugcPosts.
    async createTextPost(authorUrn: string, text: string) {
      const payload = {
        author: authorUrn,
        lifecycleState: "PUBLISHED",
        specificContent: {
          "com.linkedin.ugc.ShareContent": {
            shareCommentary: {
              text: text,
            },
            shareMediaCategory: "NONE",
          },
        },
        visibility: {
          "com.linkedin.ugc.MemberNetworkVisibility": "PUBLIC",
        },
      };
    
      const response = await this.client.post("/ugcPosts", payload);
      return response.data;
    }
  • src/index.ts:46-57 (registration)
    Registration of the 'create_text_post' tool via MCP server's ListToolsRequestSchema handler, where contentTools (including create_text_post) are spread into the tools array.
    // Register tools
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: [
          ...profileTools,
          ...contentTools,
          ...networkTools,
          ...organizationTools,
        ],
      };
    });
  • src/index.ts:58-71 (registration)
    Routing of the 'create_text_post' tool call to handleContentTool when a CallToolRequest is received with a matching tool name.
    // Handle tool execution
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      try {
        const name = request.params.name;
        const args = request.params.arguments;
    
        if (profileTools.some((t) => t.name === name)) {
          return await handleProfileTool(name, args, linkedinClient);
        }
        
        if (contentTools.some((t) => t.name === name)) {
          return await handleContentTool(name, args, linkedinClient);
        }
Behavior2/5

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

With no annotations, the description must convey behavioral traits, but it lacks details on permissions, visibility, character limits, or what happens after posting. The agent cannot infer important operational characteristics.

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, concise sentence with no unnecessary words. It is efficiently front-loaded.

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 the simple tool with one parameter and no output schema, the description is too brief. It misses crucial context such as authentication requirements, feed scope, and length constraints, reducing its completeness.

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 the baseline is 3. The description does not add any extra meaning to the 'text' parameter beyond what the schema already provides.

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 (share a simple text update) and the target (user's feed). It implies creation of a text post, distinguishing it from the sibling 'create_article_post' tool, though not explicitly.

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 like 'create_article_post'. There is no mention of prerequisites or context for appropriate usage.

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/ahmedselimmansor-ctrl/Linekedin_MCP_server'

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