# Get Document — Linear

> Fetch a single Linear document by its UUID or slugId and return the full markdown content plus metadata. Use when you need to read, show, or display the full contents of a document — Search Documents does not return the content field…

- Key: `linear-get-document`
- Type: Action (Read-only)
- Version: 0.0.1
- App: Linear (`linear`) — https://pipedream.com/apps/linear.md
- This page (HTML): https://pipedream.com/apps/linear/actions/get-document
- Hints: read-only · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/linear/actions/get-document/get-document.mjs

## Description

Fetch a single Linear document by its UUID or slugId and return the full markdown content plus metadata. Use when you need to read, show, or display the full contents of a document — **Search Documents** does not return the `content` field. Workflow: first call **Search Documents** to find the document `id` or `slugId`, then call this tool with that identifier. Provide the document UUID (e.g. `a1b2c3d4-0000-0000-0000-000000000001`) or slugId (the short code at the end of the document URL, e.g. `10b5bc2940c7`). The optional `fields` prop narrows the response to only the keys you need. Example: `documentId: "10b5bc2940c7"` → returns `{id: "29a25062-...", title: "Q3 Hiring Plan", content: "# Q3 Hiring Plan\n\nWe are looking for...", url: "https://linear.app/.../document/q3-hiring-plan-10b5bc2940c7"}`. [See the documentation](https://studio.apollographql.com/public/Linear-API/variant/current/schema/reference/objects/Query?query=document).

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `documentId` | `string` | Yes | The UUID or slugId of the document. A UUID looks like a1b2c3d4-0000-0000-0000-000000000001; a slugId is the short alphanumeric code at the end of the document URL (e.g. 10b5bc2940c7). Use Search Documents to find document IDs. |
| `fields` | `string[]` | No | Optional list of field names to include in the returned document object. When omitted, the full document payload is returned (id, title, slugId, url, content, icon, color, createdAt, updatedAt, archivedAt, documentContentId, project, initiative, creator). Pass a subset to reduce response size, e.g. ["id", "title", "content"]. |

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

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: "linear-get-document",
  arguments: {
    documentId: "Document ID",
    fields: ["Fields"],
  },
})
```

**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: "linear-get-document",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    linear: { authProvisionId: "apn_xxxxxxx" },
    documentId: "Document ID",
    fields: ["Fields"],
  },
})

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": "linear-get-document",
    "configured_props": {
      "linear": { "authProvisionId": "apn_xxxxxxx" },
      "documentId": "Document ID",
      "fields": ["Fields"]
    }
  }'
```

---

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