Tutorials/Advanced
Advanced90 minMCP

Coordinate a complete Mappls A2A journey

Validate fixture or OAuth A2A identity, select offline or purpose-bound live-read authority, delegate one exact structured task, reconcile a lost response, bind the server task identity, and review an immutable artifact.

By the endA restart-safe OAuth-capable host that keeps transport identity, provider-read purpose, protocol completion, human acceptance, entitlement, writes, and production approval separate.

Build against an explicit contract

An application must coordinate exact offline planning or purpose-bound Mappls provider reads through A2A while retaining application-owned identity, intent, privacy purpose, recovery, review, and audit authority.

A Mappls developer projectA restricted MCP applicationFixture data with no production credentialsA request, aggregate, or correlation ID strategy
Step 1

Define the user and system contract

An application must coordinate exact offline planning or purpose-bound Mappls provider reads through A2A while retaining application-owned identity, intent, privacy purpose, recovery, review, and audit authority. Record the region, data freshness, latency budget, privacy purpose, credential owner, and fallback before choosing an SDK or endpoint.

Step 2

Start with the maintained application

Download A2A Solution Studio and run its credential-free zero-network fixture. Exercise the complete offline journey first; never accept a free-form prompt, file, URL, provider credential, OAuth token, provider write, or arbitrary skill name in the task model.

AI & Location · SDK or product slice
const nearbyPlacesTool = {
  name: "mappls_search_nearby",
  description: "Find real places near a validated Mappls Pin or coordinate.",
  inputSchema: {
    type: "object",
    required: ["location", "category"],
    properties: {
      location: { type: "string", description: "Mappls Pin or 'lat,lng'." },
      category: { type: "string" },
      radiusMeters: { type: "integer", minimum: 50, maximum: 10_000 }
    }
  }
};
Step 3

Choose and pin the profile

Fetch the well-known Agent Card under a bounded response, validate A2A v1 plus JSONRPC or HTTP+JSON, require the exact structured skill, infer offline or live-read from the advertised skills, and retain the canonical card fingerprint. Keep offline as default; require the stronger mappls:a2a:live-read resource scope for protected live reads.

Use the normalized source contract below as the executable boundary. Switch tabs to compare credential-safe languages without changing the operation.

GET /models
curl --request GET \
  --url 'https://ai.mappls.com/models' \
  --header 'Authorization: Bearer YOUR_ACCESS_TOKEN'
Inspect parameters, responses, and source fingerprint
Step 4

Bind live-read purpose and data class

For one of the ten live commands, require the exact enumerated purpose and bounded operation fields. Record its data class and one-call authority before delegation. Keep Mappls provider credentials only in the A2A service; task payloads and the host never accept them.

Step 5

Bind transport identity without broadening skill authority

Obtain a short-lived token for the exact A2A resource from an approved client store, inject it only in the Authorization header, and retain only the public scope plus a transport-authenticated boolean. Never persist or log the token, reuse a Mappls provider credential, or let a request tenant override the token-bound tenant.

Step 6

Delegate with correct identities

Persist the command digest and client-owned message, context, attempt, and idempotency identities before transport. Leave task ID empty for a new A2A task, then bind the server-assigned task identity from the result.

Step 7

Reconcile an unknown outcome

If the response is lost, keep the aggregate delegated. List the unique context across task states, require exactly one matching task, bind its server identity, and inspect it rather than creating a duplicate delegation.

Step 8

Validate and review the artifact

Require completed state, matching context/task identity, one bounded structured artifact, the command’s exact zero-call offline or one-read live authority, no task-payload credentials or writes, and no production approval. Hash the canonical artifact and require an attributable reviewer to accept or reject that exact digest.

Step 9

Operate sensitive durable state

Atomically commit snapshots, immutable events, idempotency receipts, and outbox messages; keep live provider payloads out of audit and outbox events; apply tenant authorization, encryption, minimization, expiry, and deletion before adapting the sample file store; recover reconciliation evidence after restart.

Step 10

Prove the production behavior

Automate the happy path and every named failure. The release is ready only when fixture and official sdk paths preserve one host lifecycle; all three offline and ten live command contracts are explicit; agent card, profile, skill, protocol, oauth, purpose, and authority validation fail closed; missing-token, insufficient-scope, wrong-audience, and cross-tenant reads are denied; a lost response reconciles without a second task; server-assigned task identity and artifact digest survive restart; no transport token or provider payload appears in audit evidence; human acceptance never becomes entitlement, write authority, or production approval. Capture provider request identity without logging credentials or unnecessary precise location.

Failure modes you must exercise

Agent Card changes profile, authority, protocol, skill, size, OAuth metadata, or scope

Fail fast with a typed, user-safe outcome and preserve the original request identity.

authorization is missing, expired, revoked, wrong-audience, or tenant-mismatched

Keep the last verified state, mark freshness honestly, and retry only within the documented idempotency boundary.

purpose or data class is incompatible with the selected live skill

Reconcile durable local and provider evidence before declaring success or issuing a compensating command.

transport outcome is ambiguous and context resolves to zero or multiple tasks

Reconcile durable local and provider evidence before declaring success or issuing a compensating command.

task or context identity drifts

Reconcile durable local and provider evidence before declaring success or issuing a compensating command.

artifact is nonterminal, unstructured, oversized, or elevates provider calls or writes

Reconcile durable local and provider evidence before declaring success or issuing a compensating command.

review names a stale digest or aggregate version

Reconcile durable local and provider evidence before declaring success or issuing a compensating command.

exact idempotency key is replayed with changed intent

Reconcile durable local and provider evidence before declaring success or issuing a compensating command.

Never turn uncertainty into success

Timeout after a stateful command is an unknown outcome. Query by provider/idempotency identity or wait for authoritative events; do not blindly retry a new command.

Definition of done

fixture and official SDK paths preserve one host lifecycleall three offline and ten live command contracts are explicitAgent Card, profile, skill, protocol, OAuth, purpose, and authority validation fail closedmissing-token, insufficient-scope, wrong-audience, and cross-tenant reads are denieda lost response reconciles without a second taskserver-assigned task identity and artifact digest survive restartno transport token or provider payload appears in audit evidencehuman acceptance never becomes entitlement, write authority, or production approval

MCP production checks

Tools expose the least authority neededState-changing calls require explicit policy and approvalResponses identify source, freshness, and uncertaintyEvery tool call is tenant-scoped, metered, redacted, and traceable

Continue from source, contracts, and a full app

These links resolve to repository-derived evidence; unsupported package names and endpoints are not filled in from guesswork.

Study the complete Connected fleet trip state machine

Run it, break it, then observe it

Start with fixture credentials, execute the failure plan, and use request logs, usage, webhook evidence, and operational metrics before promoting traffic.