Writer ACTION
Send Prompt
Generate text with Writer's chat completion API. Use this whenever the user asks you to write, draft, compose, generate, rewrite, summarize, translate, or brainstorm any text with Writer — subject lines, announcements, welcome messages, poems, copy, headlines, translations, and similar. Route these requests through Writer (which applies the team's models) rather than answering from your own knowledge. Pass the conversation as
messages; optionally choose a model (defaults to palmyra-x5, a strong general-purpose model — creative writing included). Use List Models to discover other model ids available to the account. For questions grounded in your team's own documents, use Ask Knowledge Graph instead. Example: to draft a welcome message, call with messages=[{ "role": "user", "content": "Draft a 2-sentence welcome message for new visitors." }] and model="palmyra-x5" -> returns an OpenAI-shaped response whose choices[0].message.content holds the generated text. See the documentation- Action
- Writes data
- API key
- SDK
- MCP
IMPLEMENTATION
Call this tool
Connect a user's Writer account once, then configure and run Send Prompt from your backend or agent.
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: "writer-send-prompt",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
writer: { authProvisionId: "apn_xxxxxxx" },
messages: "Messages",
model: "Model",
},
})
console.log(result)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": "writer-send-prompt",
"configured_props": {
"writer": { "authProvisionId": "apn_xxxxxxx" },
"messages": "Messages",
"model": "Model"
}
}'// accessToken: mint a short-lived token with the Connect SDK — see the MCP guide
const transport = new StreamableHTTPClientTransport(
new URL("https://remote.mcp.pipedream.net/v3"),
{
requestInit: {
headers: {
Authorization: `Bearer ${accessToken}`,
"x-pd-project-id": "{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": "writer",
},
},
},
)
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: "writer-send-prompt",
arguments: {
messages: "Messages",
model: "Model",
},
})SCHEMA
Inputs
Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.
| Property | Type | Description |
|---|---|---|
messages Messages | string | JSON array of chat messages. Each message is { "role": ..., "content": ... } where role is one of user, assistant, system, or tool. Example: [{ "role": "system", "content": "You are a concise copywriter." }, { "role": "user", "content": "Write a 2-sentence welcome message." }]. Required |
model Model | string | The model id to generate with. Defaults to palmyra-x5 (recommended for most tasks, creative writing included). Use List Models to see all model ids available to the account. Optional |
maxTokens Max Tokens | integer | Maximum number of tokens the model may generate in the response. Optional |
temperature Temperature | string | Controls randomness/creativity, typically between 0 and 2 (default 1). Higher values (e.g. 1.5) produce more varied text; lower values (e.g. 0.2) produce more deterministic, conservative output. Optional |
topP Top P | string | Nucleus-sampling threshold between 0 and 1. Only tokens whose cumulative probability exceeds this value are considered. An alternative to temperature — generally set one or the other, not both. Example: 0.9. Optional |
n Number Of Completions | integer | How many completions to generate in a single request (default 1). Each is returned as a separate entry in the choices array. Example: 3 to get three alternatives to choose from. Optional |
stop Stop Sequences | string[] | One or more sequences that, when generated, stop the model from producing further text. Example: ["\n\n", "END"]. Optional |
logprobs Log Probabilities | boolean | Whether to return the log probabilities of the output tokens (default false). Optional |
tools Tools | string | JSON array of tool definitions the model may use, following Writer's tool schema. Use custom function tools and/or one built-in tool (graph, llm, translation, vision, or web_search) — only one built-in type per request. Example: [{ "type": "function", "function": { "name": "get_weather", "parameters": { "type": "object", "properties": { "city": { "type": "string" } } } } }]. Optional |
toolChoice Tool Choice | string | How the model decides to call tools. One of the keywords auto (default), none, or required, OR a JSON object forcing a specific function, e.g. { "type": "function", "function": { "name": "get_weather" } }. Optional |
responseFormat Response Format | string | JSON object specifying the output format (supported on palmyra-x4 and palmyra-x5). Default is plain text. For structured output pass a json_schema, e.g. { "type": "json_schema", "json_schema": { "name": "result", "schema": { "type": "object", "properties": { "title": { "type": "string" } } } } }. Optional |
REFERENCE
Tool details
Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.
- Registry key
- writer-send-prompt
- Version
- 1.0.1
- App
- Writer
- Authentication
- API key
- Read-only
- No
- Destructive
- No
- Open world
- Yes
- Source
- View on GitHub ↗