# Create Social Media Post — TextCortex

> Create a social media post. See the documentation

- Key: `textcortex-create-social-media-post`
- Type: Action (Write)
- Version: 0.0.2
- App: TextCortex (`textcortex`) — https://pipedream.com/apps/textcortex.md
- This page (HTML): https://pipedream.com/apps/textcortex/actions/create-social-media-post
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/textcortex/actions/create-social-media-post/create-social-media-post.mjs

## Description

Create a social media post. [See the documentation](https://docs.textcortex.com/api/paths/texts-social-media-posts/post)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `context` | `string` | Yes | The context of the social media post. |
| `keywords` | `string[]` | No | Keywords to be included in the post. |
| `maxTokens` | `integer` | No | The maximum number of tokens to generate. |
| `mode` | `string` | Yes | The platform, e.g. twitter to generate a Tweet. Allowed values: twitter, linkedin |
| `model` | `string` | No | The language model to use. Allowed values: velox-1, aecus-1, alta-1, sophos-1 and chat-sophos-1 |
| `n` | `integer` | No | The number of outputs to generate. |
| `sourceLang` | `string` | No | The language of the source text. |
| `targetLang` | `string` | No | The language which the text should be generated in. |
| `temperature` | `string` | No | The sampling temperature to be used in text generation. The higher the temperature, the higher the risk of the output to sound "made up". |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "textcortex",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "textcortex-create-social-media-post",
  arguments: {
    context: "Context",
    keywords: ["Keywords"],
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "textcortex-create-social-media-post",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    textcortex: { authProvisionId: "apn_xxxxxxx" },
    context: "Context",
    keywords: ["Keywords"],
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "textcortex-create-social-media-post",
    "configured_props": {
      "textcortex": { "authProvisionId": "apn_xxxxxxx" },
      "context": "Context",
      "keywords": ["Keywords"]
    }
  }'
```

---

- App: https://pipedream.com/apps/textcortex.md · All apps: https://pipedream.com/apps
