# Analyze Text — Tisane Labs

> Analyze text for language, entities, sentiment, and other insights. See the documentation

- Key: `tisane_labs-analyze-text`
- Type: Action (Read-only)
- Version: 0.0.2
- App: Tisane Labs (`tisane_labs`) — https://pipedream.com/apps/tisane-labs.md
- This page (HTML): https://pipedream.com/apps/tisane-labs/actions/analyze-text
- Hints: read-only · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/tisane_labs/actions/analyze-text/analyze-text.mjs

## Description

Analyze text for language, entities, sentiment, and other insights. [See the documentation](https://docs.tisane.ai/#561264c5-6dbe-4bde-aba3-7defe837989f)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `language` | `string` | Yes | The langauge to analyze Options are loaded from the connected account. |
| `content` | `string` | Yes | The content to analyze |
| `format` | `string` | No | The format of the content |
| `disableSpellcheck` | `boolean` | No | Determines whether the automatic spellchecking is to be disabled. Default: false |
| `lowercaseSpellcheckOnly` | `boolean` | No | Determines whether the automatic spellchecking is only to be applied to words in lowercase. Default: false |
| `minGenericFrequency` | `integer` | No | Allows excluding more esoteric terms; The valid values are 0 thru 10. |
| `subscope` | `boolean` | No | Enables sub-scope parsing, for scenarios like hashtag, URL parsing, and obfuscated content (e.g. ihateyou). Default: false |
| `abuse` | `boolean` | No | Output instances of abusive conten. Default: true |
| `sentiment` | `boolean` | No | Output sentiment-bearing snippets. Default: true |
| `documentSentiment` | `boolean` | No | output document-level sentiment. Default: false |
| `entities` | `boolean` | No | Output entities. Default: true |
| `topics` | `boolean` | No | Output topics. Default: true |
| `words` | `boolean` | No | Output the lexical chunks / words for every sentence. Default: false |
| `fetchDefinitions` | `boolean` | No | Include definitions of the words in the output. Only relevant when the words setting is true. Default: `false |
| `parses` | `boolean` | No | Output parse forests of phrases |
| `deterministic` | `boolean` | No | Whether the n-best senses and n-best parses are to be output in addition to the detected sense. If true, only the detected sense will be output. Default: true |
| `snippets` | `boolean` | No | Include the text snippets in the abuse, sentiment, and entities sections. Default: false |
| `explain` | `boolean` | No | If true, a reasoning for the abuse and sentiment snippets is provided when possible |
| `featureStandard` | `string` | No | Determines the standard used to output the features (grammar, style, semantics) in the response object |
| `topicStandard` | `string` | No | Determines the standard used to output the topics in the response object |
| `sentimentAnalysisType` | `string` | No | The type of the sentiment analysis strategy |

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

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: "tisane_labs-analyze-text",
  arguments: {
    language: "Language",
    content: "Content",
  },
})
```

**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: "tisane_labs-analyze-text",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    tisane_labs: { authProvisionId: "apn_xxxxxxx" },
    language: "Language",
    content: "Content",
  },
})

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": "tisane_labs-analyze-text",
    "configured_props": {
      "tisane_labs": { "authProvisionId": "apn_xxxxxxx" },
      "language": "Language",
      "content": "Content"
    }
  }'
```

---

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