# List Project Items — GitHub

> List the items in a Project (V2). Each item has an id, a type, and its title under fieldValueByName.text (not a flat title field). Use the returned item id with Update Project (V2) Item Status to change an item's status. Get the project…

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

## Description

List the items in a Project (V2). Each item has an `id`, a `type`, and its title under `fieldValueByName.text` (not a flat `title` field). Use the returned item `id` with **Update Project (V2) Item Status** to change an item's status. Get the project number from **List Projects** and its valid statuses from **List Project Statuses**. Discover organization logins with **List Organizations**. Returns at most 100 items with no pagination — a project with more than 100 items exposes only the last 100 (the tail of the item connection, in the connection's own order), so earlier items can't be retrieved. [See the documentation](https://docs.github.com/en/graphql/reference/projects#object-projectv2item)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `owner` | `string` | Yes | The account that owns the Project (V2) — an organization login (e.g. my-org), or a repository owner when Repository is also set. Required, and it must come from the user. If the user has not said which owner/organization the project belongs to, ask them — do NOT guess an owner or enumerate organizations to find one. If they named an organization but you need its exact login, use List Organizations. User-owned Projects are not supported. |
| `repo` | `string` | No | Optional. The repository name without the owner (e.g. my-repo, not my-org/my-repo) when the Project (V2) is repository-scoped. Leave blank to target an organization-owned Project. |
| `project` | `integer` | Yes | The Project (V2) number as shown in the project URL and UI (e.g. 5 in /orgs/my-org/projects/5) — not the node ID. Required. If the user has not provided it, ask them — do NOT guess. Once you know the owner, you can look up numbers with List Projects. |
| `maxResults` | `integer` | No | The maximum number of items to return. GitHub caps this at 100 per request. Defaults: 100 |

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

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: "github-list-project-items",
  arguments: {
    owner: "Owner",
    repo: "Repository",
  },
})
```

**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: "github-list-project-items",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    github: { authProvisionId: "apn_xxxxxxx" },
    owner: "Owner",
    repo: "Repository",
  },
})

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": "github-list-project-items",
    "configured_props": {
      "github": { "authProvisionId": "apn_xxxxxxx" },
      "owner": "Owner",
      "repo": "Repository"
    }
  }'
```

---

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