# Search Contacts (`search_contacts`)

Part of the [Outfield MCP Server](https://run.outfieldapp.com/docs/mcp) docs. All tools: [llms.txt](https://run.outfieldapp.com/docs/mcp/llms.txt). Server URL: https://run.outfieldapp.com/mcp

Search accounts (places) and people by name, company, address, email, phone or any other contact data, or browse and sort by recent activity.

Search accessible Outfield accounts and people by name, company, address, email, phone, or other contact data. When order_by is supplied, query may be omitted to browse accessible contacts. Valid order_by values are created_at, last_interaction_at (last activity; not last_activity_at), last_touchpoint_at, last_check_in_at, last_onsite_check_in_at, last_meeting_at, last_phone_call_at, last_text_message_at, last_email_at, last_progressed_deal_at, last_revenue_deal_at, and last_form_completed_ats. Use last_form_completed_ats only with root_form_id from get_forms. For example, to find accounts last checked in with 1 to 4 weeks ago, use contact_type=place, order_by=last_check_in_at, start_date, and end_date. Use cursor=meta.next_cursor to continue through additional pages while meta.has_more is true. Use a returned contact id as contact_id for get_contact_detail, get_contact_activity, or get_contact_deals. If multiple contacts could match, ask the user to clarify before loading details, activity, or deals. If the user names a team, call get_user_profile first and pass organization_id. Omit organization_id to search the current organization.

- Scopes: `ai:read`
- Requires: AI, not available to Viewer users
- Access: Admins can search every active contact in the organization. User roles see only contacts assigned to them.
- Example prompts: "Find my Best Buy account."; "Which accounts haven't I checked in on in the last 30 days?"

### Parameters

- `query` (string; optional): Full-text contact search query; required unless order_by is supplied
- `contact_type` (string; optional; one of `place`, `person`): Restrict results to place (account) or person
- `order_by` (string; optional; one of `created_at`, `last_interaction_at`, `last_touchpoint_at`, `last_check_in_at`, `last_onsite_check_in_at`, `last_meeting_at`, `last_phone_call_at`, `last_text_message_at`, `last_email_at`, `last_progressed_deal_at`, `last_revenue_deal_at`, `last_form_completed_ats`): Sort/filter field: created_at, last_interaction_at (last activity), last_touchpoint_at, last_check_in_at, last_onsite_check_in_at, last_meeting_at, last_phone_call_at, last_text_message_at, last_email_at, last_progressed_deal_at, last_revenue_deal_at, or last_form_completed_ats
- `order_direction` (string; optional; one of `asc`, `desc`): Sort direction: asc or desc. Defaults to asc when order_by is supplied
- `start_date` (string; optional; ISO 8601 date or datetime): Optional inclusive start date/time for order_by
- `end_date` (string; optional; ISO 8601 date or datetime): Optional inclusive end date/time for order_by
- `root_form_id` (integer; optional): Required when order_by is last_form_completed_ats; obtain from get_forms
- `limit` (integer; optional): Max contacts returned per page. Default 10, max 50
- `cursor` (string; optional): Opaque cursor from meta.next_cursor
- `organization_id` (integer; optional): Organization ID from get_user_profile. Omit to use the current organization. If the user names a team, call get_user_profile first and pass that id.

### Notes

- query may be omitted when order_by is supplied, which turns the tool into a browse/sort view.
- last_form_completed_ats requires root_form_id from get_forms.
- Results are paged; keep calling with meta.next_cursor while meta.has_more is true.

### Example request

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "search_contacts",
    "arguments": {
      "query": "Best Buy",
      "contact_type": "place",
      "limit": 5
    }
  }
}
```

### Example response (`structuredContent`, illustrative data)

```json
{
  "contacts": [
    {
      "id": 48213,
      "organization_id": 2044,
      "organization_name": "Acme Beverage Co.",
      "name": "Acme Grocery",
      "created_at": "2026-09-29T14:30:00-05:00",
      "updated_at": "2026-09-29T14:30:00-05:00",
      "contact_type": "place",
      "company": "Acme Grocery",
      "title": "Store Manager",
      "name_and_address": "Acme Grocery, 1200 Congress Ave, Austin, TX 78701",
      "last_interaction_at": "2026-09-29T14:30:00-05:00",
      "last_touchpoint_at": "2026-09-29T14:30:00-05:00",
      "last_check_in_at": "2026-09-29T14:30:00-05:00",
      "last_onsite_check_in_at": "2026-09-29T14:30:00-05:00",
      "last_meeting_at": "2026-09-29T14:30:00-05:00",
      "last_phone_call_at": "2026-09-29T14:30:00-05:00",
      "last_text_message_at": "2026-09-29T14:30:00-05:00",
      "last_email_at": "2026-09-29T14:30:00-05:00",
      "last_progressed_deal_at": "2026-09-29T14:30:00-05:00",
      "last_revenue_deal_at": "2026-09-29T14:30:00-05:00",
      "last_form_completed_ats": {}
    }
  ],
  "meta": {
    "query": "Best Buy",
    "contact_type": "place",
    "order_by": "Order by",
    "order_direction": "Order direction",
    "start_date": "2026-09-29",
    "end_date": "2026-09-29",
    "root_form_id": 5601,
    "limit": 5,
    "result_count": 1,
    "truncated": false,
    "has_more": false,
    "next_cursor": null,
    "organization_id": 2044,
    "organization_name": "Acme Beverage Co."
  }
}
```

### Response fields

- `contacts` (object[])
  - `id` (integer)
  - `organization_id` (integer)
  - `organization_name` (string)
  - `name` (string | null)
  - `created_at` (string): ISO8601 timestamp
  - `updated_at` (string): ISO8601 timestamp
  - `contact_type` (string | null): place or person
  - `company` (string | null)
  - `title` (string | null)
  - `name_and_address` (string | null)
  - `last_interaction_at` (string | null): ISO8601 timestamp
  - `last_touchpoint_at` (string | null): ISO8601 timestamp
  - `last_check_in_at` (string | null): ISO8601 timestamp
  - `last_onsite_check_in_at` (string | null): ISO8601 timestamp
  - `last_meeting_at` (string | null): ISO8601 timestamp
  - `last_phone_call_at` (string | null): ISO8601 timestamp
  - `last_text_message_at` (string | null): ISO8601 timestamp
  - `last_email_at` (string | null): ISO8601 timestamp
  - `last_progressed_deal_at` (string | null): ISO8601 timestamp
  - `last_revenue_deal_at` (string | null): ISO8601 timestamp
  - `last_form_completed_ats` (object | null)
- `meta` (object)
  - `query` (string | null)
  - `contact_type` (string | null)
  - `order_by` (string | null)
  - `order_direction` (string | null)
  - `start_date` (string | null): ISO8601 start of filter range
  - `end_date` (string | null): ISO8601 end of filter range
  - `root_form_id` (integer | null)
  - `limit` (integer)
  - `result_count` (integer)
  - `truncated` (boolean)
  - `has_more` (boolean)
  - `next_cursor` (string | null): Opaque cursor for the next page; null when has_more is false
  - `organization_id` (integer)
  - `organization_name` (string)

Related tools: [get_contact_detail](https://run.outfieldapp.com/docs/mcp/tools/get_contact_detail.md), [get_contact_activity](https://run.outfieldapp.com/docs/mcp/tools/get_contact_activity.md), [get_contact_deals](https://run.outfieldapp.com/docs/mcp/tools/get_contact_deals.md), [create_check_in](https://run.outfieldapp.com/docs/mcp/tools/create_check_in.md), [create_deal](https://run.outfieldapp.com/docs/mcp/tools/create_deal.md)
