# tools

```graphql
query Tools($projectReference: String!) {
  tools(projectReference: $projectReference) {
    data {
      id
      name
      description
      sourcePath
      editMode
      inputSchema
      outputSchema
    }
    pageInfo {
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
    }
    diagnostics {
      kind
      severity
      sourceKind
      sourcePath
      sourceId
      code
      message
      details
    }
  }
}
```

List tools. Requires project.agents.read.

## Arguments

| Name                  | Type              | Required | Description                                                                                                                    |
| --------------------- | ----------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------ |
| `projectReference`    | String!           | Yes      |                                                                                                                                |
| `sourceTargetKind`    | SourceTargetKind  |          | The source to read; default runtimeTargetKind, else project. One of `project`, `main_branch`, `environment`, `preview_branch`. |
| `runtimeTargetKind`   | RuntimeTargetKind |          | Used as the source to read when sourceTargetKind is omitted. One of `main_branch`, `environment`, `preview_branch`.            |
| `targetEnvironmentId` | ID                |          | Required with the kind environment.                                                                                            |
| `targetBranchId`      | ID                |          | Required with the kind preview\_branch.                                                                                        |

## Variables

```json
{
  "projectReference": "string"
}
```

## Responses

| Status | Description                  |
| ------ | ---------------------------- |
| 200    | The ToolList! in data.tools. |

## Call it

```bash
curl -X POST "https://api.veryfront.com/graphql" \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "query Tools($projectReference: String!) {\n  tools(projectReference: $projectReference) {\n    data {\n      id\n      name\n      description\n      sourcePath\n      editMode\n      inputSchema\n      outputSchema\n    }\n    pageInfo {\n      hasNextPage\n      hasPreviousPage\n      startCursor\n      endCursor\n    }\n    diagnostics {\n      kind\n      severity\n      sourceKind\n      sourcePath\n      sourceId\n      code\n      message\n      details\n    }\n  }\n}",
  "variables": {
    "projectReference": "string"
  }
}'
```

## Example response

```json
{
  "data": {
    "tools": {
      "data": [
        {
          "id": "string",
          "name": "string",
          "description": "string",
          "sourcePath": "string",
          "editMode": "structured",
          "inputSchema": {},
          "outputSchema": {}
        }
      ],
      "pageInfo": {
        "hasNextPage": false,
        "hasPreviousPage": false,
        "startCursor": "string",
        "endCursor": "string"
      },
      "diagnostics": [
        {
          "kind": "string",
          "severity": "warning",
          "sourceKind": "string",
          "sourcePath": "string",
          "sourceId": "string",
          "code": "string",
          "message": "string",
          "details": {}
        }
      ]
    }
  }
}
```
