EmailmoversMyDataHub docs
Browse the docs

Reference / MCP tool reference

Reference

Resolve a location

resolve_location: Turns free text such as 20 miles of Leeds, Yorkshire or LS1 into region, county, town, postcode or radius filters, each with a count and a ready filter.

Generated from the contractsView as Markdown

Turns free text such as 20 miles of Leeds, Yorkshire or LS1 into region, county, town, postcode or radius filters, each with a count and a ready filter. Ambiguous places come back as candidates with a question, so ask the user which they meant rather than choosing. Free and needs no account, though a radius under 5 miles needs an account. Add the chosen filter to the audience, then call count_audience. Lawful basis is UK GDPR Article 6(1)(f) legitimate interests; email audiences include corporate subscribers only by default (PECR), so sole traders and ordinary partnerships are left out unless the toggle is changed.

PropertyValue
Tool nameresolve_location
Position in tools/list6 of 22
CostFree
ScopeNone. Works without an account.
AnnotationsreadOnlyHint true, destructiveHint false, idempotentHint true, openWorldHint false
KindRead only; idempotent, not destructive, closed world
REST equivalentPOST /v1/locations/resolve

Input

The schema sets additionalProperties to false, so a member that is not listed is refused.

MemberTypeRequiredDescription
textstringyesFree text such as "20 miles of Leeds", "Yorkshire" or "SW1".
radius_milesnumber (1 to 100)no
datasetenum: uk_contacts, ie_contacts, global_contactsnoThe dataset an audience draws from. uk_contacts is live; ie_contacts and global_contacts are listed but not yet served.

Example call

The params of a tools/call request:

{
  "name": "resolve_location",
  "arguments": {
    "text": "20 miles of Leeds"
  }
}

Output

The result carries structuredContent that matches this schema, and one line of text that leads with the number.

MemberTypeAlways presentDescription
textstringyes
ambiguousbooleanyesTrue when more than one candidate fits; ask the person which they meant.
questionstring or nullyes
candidatesarray of LocationCandidateyes
candidates[].kindenum: region, county, town, local_authority, postcode_area, postcode_district, postcode_sector, postcode_unit, and 2 moreyes
candidates[].codestringyesThe filter code, or the ONS code for a centre.
candidates[].labelstringyes
candidates[].contactsinteger (0 or more) or under 10 or suppressedyesA whole number; "under 10" when disclosure control withholds a small cell; or "suppressed" when secondary suppression hides a cell of 10 or more in a cross-tab or breakdown, so totals cannot be differenced. Anonymous and trial callers see cells rounded to the nearest 5.
candidates[].centreobject or nullyes
candidates[].filterFilteryesA ready filter for this candidate.
disclosureDisclosureyesWhether these numbers are exact or protected: "under 10" cells, rounding to 5 and secondary suppression for anonymous and trial callers.
disclosure.levelenum: exact, roundedyesexact for authenticated paid callers; rounded for anonymous and trial callers, whose counts under 100 and every cell are rounded to the nearest 5.
disclosure.rounded_tointeger or nullyes5 when numbers are rounded; null when they are exact.
disclosure.secondary_suppressionbooleanyesTrue when cross-tab or breakdown cells of 10 or more were hidden as "suppressed" so totals cannot be differenced.
disclosure.notesarray of stringyes

Errors

A failed call returns isError true. The text content leads with the sentence a person acts on, then the whole problem as JSON, with code, detail, next_step and did_you_mean. A 401 and a step-up 403 are answered at HTTP level so the client can start authorisation. See Errors.