# Analyze Sentiment in Text — Eden AI

> Analyzes sentiment in the provided text. See the documentation

- Key: `eden_ai-analyze-sentiment-in-text`
- Type: Action (Read-only)
- Version: 0.0.4
- App: Eden AI (`eden_ai`) — https://pipedream.com/apps/eden-ai.md
- This page (HTML): https://pipedream.com/apps/eden-ai/actions/analyze-sentiment-in-text
- Hints: read-only · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/eden_ai/actions/analyze-sentiment-in-text/analyze-sentiment-in-text.mjs

## Description

Analyzes sentiment in the provided text. [See the documentation](https://docs.edenai.co/reference/text_sentiment_analysis_create)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `text` | `string` | Yes | The text to analyze. |
| `providers` | `string[]` | Yes | One or more providers that the data will be redirected to in order to get the processed results. See the documentation for available providers. |
| `fallbackProviders` | `string[]` | No | Providers to be used as fallback if the call to the first provider fails. To use this, you must input only one provider in the Providers prop, and you can input up to 5 fallbacks. They will be tried in the same order they are input, and it will stop on the first provider who doesn't fail. |
| `showOriginalResponse` | `boolean` | No | If set, the response will include the original response of the provider. |
| `language` | `string` | No | This should be a language code (e.g. en, fr) |

## 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": "eden_ai",
      },
    },
  },
)

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: "eden_ai-analyze-sentiment-in-text",
  arguments: {
    text: "Text",
    providers: ["Providers"],
  },
})
```

**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: "eden_ai-analyze-sentiment-in-text",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    eden_ai: { authProvisionId: "apn_xxxxxxx" },
    text: "Text",
    providers: ["Providers"],
  },
})

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": "eden_ai-analyze-sentiment-in-text",
    "configured_props": {
      "eden_ai": { "authProvisionId": "apn_xxxxxxx" },
      "text": "Text",
      "providers": ["Providers"]
    }
  }'
```

---

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