# Convert URL To LLM-Friendly Input — Jina Reader

> Converts a provided URL to an LLM-friendly input using Jina Reader. See the documentation

- Key: `jina_reader-convert-to-llm-friendly-input`
- Type: Action (Read-only)
- Version: 1.0.3
- App: Jina Reader (`jina_reader`) — https://pipedream.com/apps/jina-reader.md
- This page (HTML): https://pipedream.com/apps/jina-reader/actions/convert-to-llm-friendly-input
- Hints: read-only · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/jina_reader/actions/convert-to-llm-friendly-input/convert-to-llm-friendly-input.mjs

## Description

Converts a provided URL to an LLM-friendly input using Jina Reader. [See the documentation](https://github.com/jina-ai/reader)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `url` | `string` | No | The URL to convert to an LLM-friendly input. |
| `contentFormat` | `string` | No | You can control the level of detail in the response to prevent over-filtering. The default pipeline is optimized for most websites and LLM input. |
| `timeout` | `integer` | No | Maximum time to wait for the webpage to load. Note that this is NOT the total time for the whole end-to-end request. |
| `targetSelector` | `string` | No | Provide a list of CSS selector to focus on more specific parts of the page. Useful when your desired content doesn't show under the default settings. E.g., body, .class, #id. |
| `waitForSelector` | `string` | No | Provide a list of CSS selector to wait for specific elements to appear before returning. Useful when your desired content doesn't show under the default settings. E.g., body, .class, #id. |
| `excludedSelector` | `string` | No | Provide a list of CSS selector to remove the specified elements of the page. Useful when you want to exclude specific parts of the page like headers, footers, etc. E.g., header, .class, #id. |
| `jsonResponse` | `boolean` | No | The response will be in JSON format, containing the URL, title, content, and timestamp (if available). In Search mode, it returns a list of five entries, each following the described JSON structure. Keep in mind JSON Response will take piority over Stream mode if both are enabled. |
| `forwardCookie` | `string` | No | The API server can forward your custom cookie settings when accessing the URL, which is useful for pages requiring extra authentication. Note that requests with cookies will not be cached. E.g., <cookie-name>=<cookie-value>, <cookie-name-1>=<cookie-value>; domain=<cookie-1-domain>. Learn more here. |
| `useProxyServer` | `string` | No | The API server can utilize your proxy to access URLs, which is helpful for pages accessible only through specific proxies. E.g., http://your_proxy_server.com. Learn more here. |
| `bypassCache` | `boolean` | No | The API server caches both Read and Search mode contents for a certain amount of time. To bypass this cache, set this header to true. |
| `streamMode` | `boolean` | No | Stream mode is beneficial for large target pages, allowing more time for the page to fully render. If standard mode results in incomplete content, consider using Stream mode. Learn more here. Keep in mind JSON Response will take piority over Stream mode if both are enabled. |
| `browserLocale` | `string` | No | Control the browser locale to render the page. eg. en-US. Learn more here. |
| `iframeContent` | `boolean` | No | Returning result will also include the content of the iframes on the page. |
| `shadowDomContent` | `boolean` | No | Returning result will also include the content of the shadow DOM on the page. |
| `pdf` | `string` | No | The path or URL to the pdf file. |
| `html` | `string` | No | The path or URL to the html file. |
| `syncDir` | `dir` | No | SyncDir |

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

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: "jina_reader-convert-to-llm-friendly-input",
  arguments: {
    url: "URL",
    contentFormat: "Content Format",
  },
})
```

**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: "jina_reader-convert-to-llm-friendly-input",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    jina_reader: { authProvisionId: "apn_xxxxxxx" },
    url: "URL",
    contentFormat: "Content Format",
  },
})

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": "jina_reader-convert-to-llm-friendly-input",
    "configured_props": {
      "jina_reader": { "authProvisionId": "apn_xxxxxxx" },
      "url": "URL",
      "contentFormat": "Content Format"
    }
  }'
```

---

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