# create_goal_criteria_agent

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/goal_rubric/create_goal_criteria_agent)

Create the ephemeral server-side criteria agent graph.

## Signature

```python
create_goal_criteria_agent(
    *,
    model: str | BaseChatModel,
    repository_backend: BackendProtocol | None,
    repository_root: str = '/',
    context_tools: Sequence[BaseTool | Callable[..., Any]],
    model_retries: int = DEFAULT_MODEL_RETRIES,
    cli_max_retries: int | None = None,
    environ: Mapping[str, str] | None = None,
) -> Any
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `model` | `str \| BaseChatModel` | Yes | Chat model or model identifier used by the server graph. |
| `repository_backend` | `BackendProtocol \| None` | Yes | Server backend rooted at the active repository or sandbox, or `None` when repository context is unavailable. |
| `repository_root` | `str` | No | Absolute path that bounds reads on `repository_backend`. (default: `'/'`) |
| `context_tools` | `Sequence[BaseTool \| Callable[..., Any]]` | Yes | Loaded `fetch_url`, optional `web_search`, and MCP tools. |
| `model_retries` | `int` | No | Model-node retry attempts after the first call. (default: `DEFAULT_MODEL_RETRIES`) |
| `cli_max_retries` | `int \| None` | No | Explicit `--max-retries` value for runtime model switches. (default: `None`) |
| `environ` | `Mapping[str, str] \| None` | No | Workspace environment retained for runtime model switches. (default: `None`) |

## Returns

`Any`

Compiled criteria agent graph.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/2069079e09546060f5b52b2cd4f0e3c813e820f3/libs/code/deepagents_code/goal_rubric.py#L1586)