> This page is for Agent Handler.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.merge.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.merge.dev/_mcp/server.

# MyCase

**Authentication:** OAuth. See [Magic Link](/merge-agent-handler/features/magic-link) for the runtime auth flow, or [Application credentials](/merge-agent-handler/admin-setup/add-oauth-credentials) to bring your own OAuth app.

## Sample use cases

* Create a case for a new client and add a filing deadline to the calendar.
* List the open tasks on the Johnson estate case.
* Update a client's contact details.

## Available Tools

#### create_calendar_event

Create a calendar event. Call list_staff first: MyCase requires at least one staff_id.

#### create_case

Create a case. Optionally put a client on it (find or create one with list_clients/create_client) and set stage_id (from list_case_stages).

#### create_case_document

Upload a staged file to a case as a document.

#### create_client

Create a client (person). Returns the new client's ID, which create_case and create_client_relationship take as client_id.

#### create_client_relationship

Add a client to an existing case (e.g. a co-plaintiff), with an optional role.

#### create_company

Create a company (insurer, medical provider, employer, etc.). Returns its ID.

#### create_task

Create a task. Call list_staff first: MyCase requires at least one staff_id.

#### delete_calendar_event

Permanently delete a calendar event. Use list_calendar_events to find event IDs.

#### delete_case

Permanently delete a case. MyCase refuses to delete an open case: close it first with update_case `status='closed'.`

#### delete_client

Permanently delete a client (person). Use list_clients to find client IDs.

#### delete_company

Permanently delete a company. Use list_companies to find company IDs.

#### delete_task

Permanently delete a task. Use list_tasks to find task IDs.

#### get_calendar_event

Get a single calendar event by ID. Use list_calendar_events to find event IDs.

#### get_case

Get a single case by ID. Use list_cases to find case IDs.

#### get_client

Get one client (person) by ID. Use list_clients to find client IDs.

#### get_company

Get a single company by ID. Use list_companies to find company IDs.

#### get_firm

Get the name and site URL of the firm the connection belongs to.

#### get_task

Get a single task by ID. Use list_tasks to find task IDs.

#### list_calendar_events

List the firm's calendar events. Filter by updated_after; each event carries its case ID and start/end.

#### list_case_documents

List the documents filed under one case. Use list_cases to find case IDs. Paginate with page_info.next_page_token.

#### list_case_stages

List the firm's case pipeline stages (e.g. Discovery, In Trial).

#### list_cases

List the firm's cases. Filter by status ('open'/'closed') or updated_after.

#### list_client_cases

List all cases for one client. Use list_clients to find the client ID. Use list_cases instead to browse the whole firm.

#### list_clients

List the firm's clients (people). Filter by exact email, first_name or last_name (case-insensitive) or updated_after.

#### list_companies

List companies (insurers, medical providers, employers, other organizations).

#### list_staff

List the firm's staff (users such as lawyers and paralegals).

#### list_tasks

List the firm's tasks. Filter by updated_after; each task carries its case ID. Paginate with page_info.next_page_token.

#### update_calendar_event

Update a calendar event. Only supplied fields change; returns the updated event.

#### update_case

Update a case: name, number, description, status (e.g. close it), stage_id (from list_case_stages) or opened_date.

#### update_client

Update a client (person). Only supplied fields change; returns the updated client. Use list_clients to find client IDs.

#### update_company

Update a company. Only supplied fields change; returns the updated company. Use list_companies to find company IDs.

#### update_task

Update a task: name, description, priority, due_date, or completed (true marks it done).