# update_goal

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/goal_tools/GoalToolsMiddleware/__init__/update_goal)

Report a blocked goal or attach optional completion evidence.

Use `blocked` when you cannot proceed without user input. Goals complete
automatically after a satisfied goal-backed grading turn, so `complete`
is optional and only stages its evidence for that result. Do not create,
pause, resume, clear, or replace goals — those are user-controlled.

## Signature

```python
update_goal(
    status: Literal['complete', 'blocked'],
    note: str,
    tool_call_id: Annotated[str, InjectedToolCallId],
    state: Annotated[dict[str, Any], InjectedState],
) -> Command[Any]
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `status` | `Literal['complete', 'blocked']` | Yes | `complete` to attach completion evidence, or `blocked` when you are stuck and need the user. |
| `note` | `str` | Yes | Evidence the criteria are satisfied, or the specific blocker. Required when calling this tool. |
| `tool_call_id` | `Annotated[str, InjectedToolCallId]` | Yes | Injected tool call ID for the tool response. |
| `state` | `Annotated[dict[str, Any], InjectedState]` | Yes | Injected graph state holding the current goal. |

## Returns

`Command[Any]`

Command that updates goal status and returns a tool message.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/e14e0adcbe78565ed3650e7f24b2a775d5437d25/libs/code/deepagents_code/goal_tools.py#L373)