# Get Knowledge Items — TOPdesk

> Returns a list of Knowledge Items. See the documentation

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

## Description

Returns a list of Knowledge Items. [See the documentation](https://developers.topdesk.com/explorer/?page=knowledge-base#/Knowledge%20Items/getKnowledgeItems)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `maxResults` | `integer` | No | Maximum number of knowledge items to return. Leave empty to return all items. |
| `fields` | `string[]` | No | Additional fields to include in the response. ID and number are always included. |
| `query` | `string` | No | A FIQL query to filter the response. Use semicolons to combine multiple conditions. Available filter fields: parent.id, parent.number visibility.sspVisibility, visibility.sspVisibleFrom, visibility.sspVisibleUntil visibility.sspVisibilityFilteredOnBranches, visibility.operatorVisibilityFilteredOnBranches visibility.publicKnowledgeItem, visibility.branches.id, visibility.branches.name manager.id, manager.name status.id, status.name standardSolution.id, standardSolution.name externalLink.id, externalLink.type, externalLink.date archived, news Operators: == (equals), != (not equals) =gt= (greater than), =ge= (greater than or equal) =lt= (less than), =le= (less than or equal) =in= (in list), =out= (not in list) Example: parent.id==3fa85f64-5717-4562-b3fc-2c963f66afa6;externalLink.id=in=(oneTool,otherTool) See the documentation for more information. |
| `language` | `string` | No | The language of the Knowledge Item content, in BCP 47 format (e.g., en) |

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

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: "topdesk-get-knowledge-items",
  arguments: {
    maxResults: 10,
    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: "topdesk-get-knowledge-items",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    topdesk: { authProvisionId: "apn_xxxxxxx" },
    maxResults: 10,
    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": "topdesk-get-knowledge-items",
    "configured_props": {
      "topdesk": { "authProvisionId": "apn_xxxxxxx" },
      "maxResults": 10,
      "fields": ["Fields"]
    }
  }'
```

---

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