> ## Documentation Index
> Fetch the complete documentation index at: https://veryfront.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Create project resource

> Create a project resource, an MCP resource definition under resources/, in the project source or a preview branch; returns the project resource source document.

`veryfront__create_project_resource`

Requires project.files.write.

## Access

No external-service connection is required. Use a Veryfront credential with access to the requested resources.

**Call type:** Can change resources.

## Arguments

| Field | Type | Required | Description and constraints |
| - | - | - | - |
| `project_reference` | `string` | No | Project ID or slug |
| `id` | `string` | Yes | Resource ID, unique among the project resources. Minimum length: `1`. |
| `pattern` | `string` | Yes | URI pattern the resource answers, such as /users/:userId/profile. Minimum length: `1`. |
| `description` | `string` | Yes | What the resource returns. Minimum length: `1`. |
| `title` | `string or null` | No | Display title. Omit it or send null for no title. |
| `source_target_kind` | `string` | No | The source to write: project (the default) or `preview_branch`. Values: `"project"`, `"preview_branch"`. |
| `target_branch_id` | `string or null` | No | The preview branch to write. Required with `preview_branch` and not accepted with project. |

## Example request

Send this JSON-RPC request through an initialized MCP client. Replace sample identifiers and values before calling the tool. See [MCP client setup](https://veryfront.com/docs/cloud/getting-started/connect-mcp.md).

```json title="request.json" theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "veryfront__create_project_resource",
    "arguments": {
      "id": "example",
      "pattern": "example",
      "description": "example"
    }
  }
}
```

## Result

The published output shape is summarized below. Inspect both the MCP response content and `isError` when handling a call.

| Field | Type | Required | Description and constraints |
| - | - | - | - |
| `id` | `string` | Yes | Unique identifier for the returned record. |
| `pattern` | `string` | Yes | |
| `description` | `string` | Yes | Human-readable description returned by the tool. |
| `title` | `string or null` | Yes | Short human-readable title returned by the tool. |
| `source_path` | `string` | Yes | |
| `source` | `string` | Yes | |
| `edit_mode` | `string` | Yes | Values: `"structured"`, `"source_only"`. |
| `source_only_reasons` | `string[]` | Yes | List of source only reasons associated with this tool result. |

## Full schemas

```json title="input-schema.json" theme={null}
{
  "type": "object",
  "properties": {
    "project_reference": {
      "type": "string",
      "description": "Project ID or slug"
    },
    "id": {
      "type": "string",
      "minLength": 1,
      "description": "Resource ID, unique among the project resources."
    },
    "pattern": {
      "type": "string",
      "minLength": 1,
      "description": "URI pattern the resource answers, such as /users/:userId/profile."
    },
    "description": {
      "type": "string",
      "minLength": 1,
      "description": "What the resource returns."
    },
    "title": {
      "type": [
        "string",
        "null"
      ],
      "description": "Display title. Omit it or send null for no title."
    },
    "source_target_kind": {
      "type": "string",
      "enum": [
        "project",
        "preview_branch"
      ],
      "description": "The source to write: project (the default) or preview_branch."
    },
    "target_branch_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid",
          "description": "Provide the target branch id."
        },
        {
          "type": "null",
          "description": "Provide the target branch id."
        }
      ],
      "description": "The preview branch to write. Required with preview_branch and not accepted with project."
    }
  },
  "required": [
    "id",
    "pattern",
    "description"
  ],
  "additionalProperties": false,
  "description": "Arguments for the create_project_resource tool.",
  "$schema": "http://json-schema.org/draft-07/schema#"
}
```

```json title="output-schema.json" theme={null}
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique identifier for the returned record."
    },
    "pattern": {
      "type": "string"
    },
    "description": {
      "type": "string",
      "description": "Human-readable description returned by the tool."
    },
    "title": {
      "type": [
        "string",
        "null"
      ],
      "description": "Short human-readable title returned by the tool."
    },
    "source_path": {
      "type": "string"
    },
    "source": {
      "type": "string"
    },
    "edit_mode": {
      "type": "string",
      "enum": [
        "structured",
        "source_only"
      ]
    },
    "source_only_reasons": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "List of source only reasons associated with this tool result."
    }
  },
  "required": [
    "id",
    "pattern",
    "description",
    "title",
    "source_path",
    "source",
    "edit_mode",
    "source_only_reasons"
  ],
  "additionalProperties": false,
  "description": "Structured result returned by the create_project_resource tool.",
  "$schema": "http://json-schema.org/draft-07/schema#"
}
```

<details>
  <summary>Try this tool</summary>

  Replace sample arguments with values for your project or connected account. Calls run only when you select Run tool.

  MCP tool call

  Call `veryfront__create_project_resource` against the Veryfront MCP endpoint.

  Bearer token or API key

  Arguments (JSON)

  Run this tool with these arguments.

  Run tool

  Output JSON

  <pre />
</details>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.