For developers and agents

From your first account
to an MCP connection.

Check the existing connection and start OAuth from the client. Sign the person up only if they need an account, preserving the connector’s continuation. Manual signup with a password remains at /signup.

01
Check the connection

Reuse the correct connector and identity.

02
Sign in or create an account

Start with OAuth and preserve continuation.

03
Confirm access

Check account, workspace, and permissions.

Public documentation, no login required. Fictional examples: replace them with the real information provided by the person. The account belongs to that person and MCP access requires their authorization. Example payloads are identical in every language; some placeholder values and example error messages remain in Portuguese. API field names, endpoints, scopes, and status values do not change with the conversation language.

How to guide signup in a conversation

Before signing the person up or adding another connector, check the AI client for an existing server with the exact URL https://platform.logcomex.ai/mcp. If logcomex_connection_status is available on that connector, call it with next.verifyConnection.arguments when a handoff is available; without an expected identity, use {}. Compare mcpServer, userId, and tenantId with next.verifyConnection.expected when available; otherwise confirm the returned account and workspace with the person. If they match, reuse the connection and resume the original request without another signup or OAuth authorization.

A connector name or a missing tool does not prove that the connector is wrong. Inspect its configuration or ask the person to check its URL. If v2 is configured but needs authorization or uses another account/workspace, reauthorize the same connector. On the OAuth page, the person checks the email address and workspace and can choose “Sign in with another account” or “Create a new account and connect”. Add a connector only after confirming that none matches v2. https://mcp.logcomex.ai is a different legacy integration.

To create an account and return connected to the MCP client, start the OAuth connection before signup. Use the client’s connect or reconnect control for the exact v2 server. On the sign-in page, choose “Create account and connect”; if another account is already signed in, choose “Create a new account and connect”. Confirm the email and profile in the page opened by authorization. This path preserves returnTo and returns the person to the original client after confirming signup and access. The client produces its own state, callback, and PKCE. Do not open a fresh /signup/agent or sign up in a separate HTTP session for this flow.

If the client cannot add or authorize a server, provide the exact URL and instructions for manual Streamable HTTP and OAuth setup. Keep the connection pending until verification. If the request is only to create an account, or the connection cannot start yet, passwordless signup remains available at https://platform.logcomex.ai/signup/agent or through the API. Manual signup with a password remains at https://platform.logcomex.ai/signup.

For separate signup, when the request is only to create an account or the person chooses to continue without an immediate connection, ask for the real email address and send POST /api/auth/signup/start. Wait for the code received and provided by the person, then send their name, company, WhatsApp number, and code to POST /api/auth/signup/verify. Do not ask for a password, invent the code, or replace an existing account without the person choosing it. In a browser, /signup/agent performs these steps; direct API use requires a tool capable of HTTPS POST with JSON. Reading documentation does not enable tools; follow the client’s permissions.

The agent’s HTTP session is separate from the person’s browser session. Signup started without the client’s OAuth request can require another browser sign-in; that does not mean account creation failed. Do not promise automatic session transfer or copy cookies or OAuth codes between clients. If the account already exists, continue sign-in and authorization without repeating signup or an old OTP.

Complete flow

  1. Check the existing connector by exact URL and logcomex_connection_status. If the expected account and workspace match, reuse the connection and resume the request.
  2. If authorization is missing, use the same v2 connector; add one only when none matches. To create and connect a new account, let the client start OAuth before signup.
  3. On the OAuth page, check the email address and workspace. Sign in to the correct account or choose “Create account and connect” (“Create a new account and connect” if already signed in), preserving returnTo. Only if an account is needed, verify the email code and provide name, company, and WhatsApp; handle workspace choice, approval, and MFA.
  4. If oauth.status: authorized is present, follow exactly oauth.redirectUrl so the original client completes PKCE. Do not start another authorization. Otherwise follow next and use normal sign-in and consent in the same connector.
  5. Signup in the agent’s HTTP session does not automatically authenticate the person’s browser. If necessary, the person signs in again and checks their identity before authorizing; do not repeat signup.
  6. After connection, call logcomex_connection_status and compare mcpServer, userId, and tenantId with next.verifyConnection.expected, or confirm with the person when expected values are unavailable. Only then confirm connection and resume the original request.

Signup does not require the agent to set a password. To sign in later, the person uses an email code at /auth. Accounts with MFA complete the normal login flow with the second factor.

Signup and authorization in one confirmation

To create and connect an account in the same authorization, start OAuth from the MCP client before signup. Signup can then reuse that request and return control to the same client. Before confirming, the person must see the application name, destination domain, scopes, and workspace being created. The “Create/confirm account and connect” button records this explicit authorization; an agent flow does not waive consent.

Use the relative /oauth/authorize?... authorizationUrl produced by the MCP client, with its callback, state, and PKCE. Do not invent or reconstruct these parameters, and do not use source=agent as authorization. In the same browser or HTTP client that will verify signup, send POST /api/auth/signup/oauth-context:

JSON
{
  "email": "ana@example.com",
  "authorizationUrl": "/oauth/authorize?response_type=code&client_id=example-client&redirect_uri=https%3A%2F%2Fexample.com%2Foauth%2Fcallback&scope=agents%3Aread&state=STATE_DO_CLIENTE&code_challenge=E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM&code_challenge_method=S256&resource=https%3A%2F%2Fplatform.logcomex.ai%2Fmcp",
  "locale": "pt-BR"
}

Illustrative HTTP 200 response. It also sets an HttpOnly, Secure, SameSite=Lax nonce cookie and Cache-Control: no-store. This is only a validated preview: it does not create an account, grant, or access token.

JSON
{
  "contextToken": "CONTEXTO_OPACO_RETORNADO_PELA_PREVIA",
  "expiresAt": "2026-11-01T12:10:00Z",
  "clientName": "Assistente Exemplo",
  "clientUri": "https://example.com",
  "redirectUri": "https://example.com/oauth/callback",
  "mcpServer": "https://platform.logcomex.ai/mcp",
  "scopes": [
    {
      "id": "agents:read",
      "label": "Consultar modelos disponíveis, acompanhar análises e acessar seus resultados"
    }
  ]
}

The contextToken lasts ten minutes and is bound to the email address and cookie issued with the preview. Preserve the cookie in the same client; do not transfer the context to another browser, forge it, or reuse it for another signup or after completion. Show the person clientName, clientUri when present, redirectUri, scopes, and the intended workspace. Only after explicit confirmation, send the real code to POST /api/auth/signup/verify together with oauthContext and authorizeClient: true:

JSON
{
  "email": "ana@example.com",
  "code": "123456",
  "displayName": "Ana Exemplo",
  "tenantName": "Empresa Exemplo",
  "whatsapp": "+12025550123",
  "oauthContext": "CONTEXTO_OPACO_RETORNADO_PELA_PREVIA",
  "authorizeClient": true
}

If verification asks for a workspace choice, retain the context only while valid and show the chosen company again before confirmation. The same pair can accompany POST /api/auth/signup/workspace with action: create_workspace. Do not send it with join_workspace; pending membership requires approval.

When a new workspace was created and matches the effective session workspace, the response may include the additional field below alongside AuthUser, the web cookie, and next. oauth.status: authorized means consent was confirmed, not that the MCP connection has been verified:

JSON
{
  "oauth": {
    "status": "authorized",
    "redirectUrl": "https://example.com/oauth/callback?code=CODIGO_DE_USO_UNICO&state=STATE_DO_CLIENTE&iss=https%3A%2F%2Fplatform.logcomex.ai"
  }
}

The browser follows exactly oauth.redirectUrl, the validated HTTPS callback with a single-use code, state, and iss. Do not log this address or save it in storage. The original MCP client validates the callback and exchanges the code with its code_verifier; the signup API does not return a Bearer token. Do not start another authorization when this callback was returned. Then call logcomex_connection_status and compare it with next.verifyConnection.expected before resuming the original request.

This shortcut requires an HTTPS callback and a valid context in the same client. Native clients, signup started outside the connector, and incompatible OAuth requests continue through normal consent. An existing account, different effective workspace, pending approval, MFA, or OAuth completion failure also use the normal flow; do not repeat signup for an account already created. Missing oauth does not invalidate AuthUser or the cookie. If the context expires before verification, obtain a new preview and new confirmation from the person; invalid context is rejected before consuming the OTP.

1. Send the code

POST /api/auth/signup/start

Content-Type: application/json. No prior token or cookie is required.

JSON
{"email": "ana@example.com"}

HTTP 202 response:

JSON
{
  "status": "verification_required",
  "verificationMethod": "email_otp",
  "verificationEndpoint": "/api/auth/signup/verify",
  "documentationUrl": "/developers/mcp.html",
  "next": {
    "action": "verify_email",
    "serverName": "Logcomex AI v2",
    "mcpServer": "https://platform.logcomex.ai/mcp",
    "auth": "oauth2",
    "transport": "streamable_http",
    "resourceMetadataUrl": "https://platform.logcomex.ai/.well-known/oauth-protected-resource/mcp",
    "documentationUrl": "https://platform.logcomex.ai/developers/mcp.html",
    "connectionStatus": "not_verified",
    "instructions": [
      "Ask the person for the six-digit code received by email and any missing profile details, then call the verification endpoint.",
      "HTTP 202 accepts the request; it does not confirm email delivery, account creation or an MCP connection."
    ],
    "endpoint": "https://platform.logcomex.ai/api/auth/signup/verify"
  }
}

HTTP 202 confirms receipt of the request; the generic response does not guarantee email delivery.

Wait for the code the person receives and provides to complete the requested signup. The email address must be real and accessible to them; starting signup does not prove ownership or grant product access. The OTP proves access to the email; the API does not distinguish manual from automated mailbox access. Do not try to guess the code. If it needs to be resent, repeat this endpoint while respecting the attempt limits.

Public responses also include next with the current action. At the start, next.action is verify_email; the presence of the MCP address does not grant access before verification and approvals.

2. Confirm and create the account

POST /api/auth/signup/verify

JSON
{
  "email": "ana@example.com",
  "code": "123456",
  "displayName": "Ana Exemplo",
  "tenantName": "Empresa Exemplo",
  "whatsapp": "+12025550123"
}

123456 is only an example. Use the six-digit code the person received.

FieldRule
emailThe same email address used to start signup.
codeThe six-digit code provided by the person.
displayNameThe person's name, from 2 to 100 characters.
tenantNameThe company name, from 2 to 100 characters.
whatsappA real, valid WhatsApp number; prefer international format with + and the country code. It remains required.
activationCodeOptional. An activation code provided by the person, up to 64 characters.
oauthContext + authorizeClientOptional, sent together with authorizeClient: true only after the person reviews and confirms the OAuth context. Require the same email address and preview cookie.
ResponseMeaning and next step
HTTP 201 with userId, tenantId, email, displayName, role, tenantName, tenantSlugAn account with workspace access and a web cookie. If oauth.status: authorized is present, follow oauth.redirectUrl to complete the same client request; otherwise, use next.mcpServer to connect. next.action: connect_mcp still requires verifying the connection.
HTTP 200, status: domain_choice_requiredA workspace is suggested for the domain. Ask the person to choose between creating a company and requesting access to the existing one.
HTTP 201, status: workspace_pending_platform_approvalThe workspace was created and is awaiting platform approval. Wait for approval before connecting MCP.

Existing workspace, plan, and trial rules still apply. The configured trial may grant immediate access; signup does not guarantee a plan, trial duration, or automatic approval.

Account created: continue to the correct MCP server

The response includes next so the agent can continue without searching for another connector. Example HTTP 201 with access granted, without a combined OAuth context; identifiers are fictional:

JSON
{
  "userId": "00000000-0000-4000-8000-000000000002",
  "tenantId": "00000000-0000-4000-8000-000000000001",
  "email": "ana@example.com",
  "displayName": "Ana Exemplo",
  "role": "owner",
  "tenantName": "Empresa Exemplo",
  "tenantSlug": "empresa-exemplo",
  "next": {
    "action": "connect_mcp",
    "serverName": "Logcomex AI v2",
    "mcpServer": "https://platform.logcomex.ai/mcp",
    "auth": "oauth2",
    "transport": "streamable_http",
    "resourceMetadataUrl": "https://platform.logcomex.ai/.well-known/oauth-protected-resource/mcp",
    "documentationUrl": "https://platform.logcomex.ai/developers/mcp.html",
    "connectionStatus": "not_verified",
    "instructions": [
      "Account access is ready; the MCP connection has not been verified.",
      "Before adding a connector or starting OAuth, inspect an existing connector's exact server URL and call verifyConnection.tool with verifyConnection.arguments when available. Only verificationStatus=matched confirms the expected server, account and workspace; then reuse that connection and resume the original request without another signup or authorization.",
      "If verificationStatus=mismatch, stop the original task. For nextAction=reauthorize, use the AI client's account-switch or reauthorization control to reauthorize that same connector. Ask the person to check the email and workspace on the OAuth page and choose another account there when needed. For nextAction=connect_correct_server, select the connector with the exact mcpServer URL.",
      "If the existing v2 connector needs authorization, use the AI client's authorization control for that same connector before verifying again.",
      "connectionStatus=connected describes the actual bearer identity, not a match with the signup account. This read-only verification never switches accounts, disconnects a connector or revokes authorization; reauthorization must be completed in the AI client.",
      "Add the exact mcpServer URL only when no matching connector exists. A missing tool or a display name alone does not prove that a connector is wrong; inspect its configuration or ask the person to check it. https://mcp.logcomex.ai is a different, legacy service.",
      "The agent's HTTP session is separate from the person's browser session. Signup started outside the client's OAuth flow can still require browser sign-in; do not promise automatic session transfer. The signup cookie is not an MCP bearer token, and opening mcpServer as a web page does not connect the client.",
      "If this client cannot add or authorize an MCP server, give the person mcpServer and these steps, then wait for the connection.",
      "If the account already exists or the connection is lost, resume sign-in and MCP authorization instead of repeating signup.",
      "After authorization, call verifyConnection.tool with verifyConnection.arguments again and require verificationStatus=matched before declaring the connection complete or resuming the original request."
    ],
    "verifyConnection": {
      "tool": "logcomex_connection_status",
      "arguments": {
        "expected": {
          "mcpServer": "https://platform.logcomex.ai/mcp",
          "userId": "00000000-0000-4000-8000-000000000002",
          "tenantId": "00000000-0000-4000-8000-000000000001"
        }
      },
      "expected": {
        "mcpServer": "https://platform.logcomex.ai/mcp",
        "userId": "00000000-0000-4000-8000-000000000002",
        "tenantId": "00000000-0000-4000-8000-000000000001"
      }
    }
  }
}

Use the tenantId actually returned by the session, which may differ from the requested workspace. Do not repeat signup just because the MCP connection is missing. next.connectionStatus: not_verified means this response does not yet confirm an OAuth/MCP connection. If the account was already created, do not resend signup/verify with the old OTP: sign in with the same account and continue connecting. If next.verifyConnection.expected is unavailable, confirm the account and workspace reported by logcomex_connection_status with the person; never use the example identifiers.

Follow next.action: verify_email asks for the code; choose_workspace asks for the person’s decision; wait_for_platform_approval and wait_for_workspace_approval require waiting for approval and then signing in again. For an MFA error, details.next.action: sign_in_with_mfa directs the person to complete normal login. None of these states means the agent is already connected.

Connect the exact URL https://platform.logcomex.ai/mcp in the MCP client. https://mcp.logcomex.ai is the legacy integration and is not the destination for this signup. A connector named “Logcomex” is suitable for this step only if it points to the v2 URL. Opening /mcp as a browser page neither installs the connector nor starts authorization on its own.

If the client cannot add or connect the server automatically, give the person the URL above and ask them to open the client’s connector/MCP settings, add a server using Streamable HTTP and OAuth authentication, and authorize with the same account. Keep the step at “account created; connection pending” until the tool confirms it. Do not ask for an API key or transfer the web cookie to MCP.

3. Choose a workspace when requested

For domain_choice_required, the response contains domain, workspace.tenantId, workspace.name, workspace.memberCount, decisionToken, and expiresAt. Use the returned values; do not invent the workspace identifier or token.

POST /api/auth/signup/workspace

To create a company:

JSON
{
  "email": "ana@example.com",
  "decisionToken": "DECISION_TOKEN_RECEBIDO_NA_VERIFICACAO",
  "action": "create_workspace",
  "displayName": "Ana Exemplo",
  "tenantName": "Empresa Exemplo",
  "whatsapp": "+12025550123"
}

To request access to the suggested workspace:

JSON
{
  "email": "ana@example.com",
  "decisionToken": "DECISION_TOKEN_RECEBIDO_NA_VERIFICACAO",
  "action": "join_workspace",
  "joinTenantId": "00000000-0000-4000-8000-000000000001",
  "displayName": "Ana Exemplo",
  "whatsapp": "+12025550123"
}

In the second example, replace joinTenantId with the returned workspace.tenantId. displayName and whatsapp are required in both paths. activationCode remains optional.

Creating a workspace returns HTTP 201 with access or workspace_pending_platform_approval. Requesting membership returns HTTP 202 with status: join_request_pending and workspace.name: a company administrator must approve membership.

This contract has no signup polling endpoint. To check access after approval, the person returns to the normal login flow. decisionToken expires and can only be used once; restart signup if the decision expires or the suggested workspace changes.

4. Authorize MCP

If you already received oauth.status: authorized, follow the oauth.redirectUrl callback in the same client and proceed to verification through the MCP tool. The steps in this section apply when that field was not returned.

Without oauth.status: authorized, first check whether the existing v2 connector already responds to logcomex_connection_status. The correct identity and workspace let you reuse it and resume without another authorization. If they differ or sign-in is pending, reauthorize the same connector and choose “Sign in with another account” on the OAuth page when needed. The agent’s HTTP session does not transfer sign-in to the browser; signup without prior OAuth may require an additional sign-in. Add another connector only if none matches the exact URL.

Account creation and MCP consent are distinct permissions. In the combined flow above, the person can confirm both during signup; without that context, authorization happens afterward through the client. The session cookie returned by signup does not work as a Bearer token for MCP. The agent's HTTP client session also does not automatically sign in the person's browser.

  1. Discover the resource at GET /.well-known/oauth-protected-resource/mcp and the OAuth server at GET /.well-known/oauth-authorization-server. Check the issuer and use the advertised endpoints.
  2. If your client needs dynamic registration and registration_endpoint is advertised, register the OAuth application. This registration returns a client_id; it does not create a person, company, or permission to access data.
  3. Generate an unpredictable state and a PKCE pair using S256. Open authorization_endpoint in the person's browser with response_type=code, client_id, redirect_uri, scope, state, code_challenge, code_challenge_method=S256, and resource=https://platform.logcomex.ai/mcp.
  4. The person signs in at /auth with the same account, checks the active workspace shown in consent, and approves the permissions. If it is not the expected workspace, switch workspaces in the platform and restart authorization from the client. If a new account is needed, use “Create account and connect” on that same page, preserving returnTo; do not open a separate signup.
  5. At the callback, validate state and iss according to the server metadata. Exchange the code at token_endpoint using an application/x-www-form-urlencoded form: grant_type=authorization_code, client_id, code, the same redirect_uri, code_verifier, and the same resource.
  6. Use the returned OAuth access_token in Authorization: Bearer … on the MCP server.

Fictional example of application registration at /oauth/register, when advertised:

JSON
{
  "client_name": "Assistente Exemplo",
  "redirect_uris": ["https://example.com/oauth/callback"],
  "token_endpoint_auth_method": "none",
  "grant_types": ["authorization_code", "refresh_token"],
  "response_types": ["code"],
  "scope": "agents:read"
}

Public clients do not receive a client_secret. HTTPS callbacks depend on the installation's registration policy; in approved-URL mode, an administrator must authorize the exact URL. Native clients can use an HTTP callback at 127.0.0.1, with a local-only listener and a browser on the same computer. JavaScript calls from another origin also depend on CORS.

Request only the scopes you need and check scopes_supported during discovery. agents:read lets you start with the catalog; execution requires agents:run. Final access also depends on the person's permissions and the workspace's subscribed features.

5. Call MCP and renew access

Use an MCP client compatible with the platform's HTTP transport. Call initialize, negotiate a supported version, and then use tools/list to discover the available tools. The client must handle JSON-RPC errors, revoked authorization, and an empty catalog.

For your own HTTP implementation, the platform accepts version 2026-07-28. Send MCP-Protocol-Version, Mcp-Method with the JSON-RPC method, and Accept: application/json, text/event-stream in calls. Include the client version and capabilities in params._meta, as shown in this tools/list example:

JSON
{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "tools/list",
  "params": {
    "_meta": {
      "io.modelcontextprotocol/protocolVersion": "2026-07-28",
      "io.modelcontextprotocol/clientCapabilities": {}
    }
  }
}

This example follows initialize; do not use it as a substitute for negotiation. The Mcp-Method header must be tools/list for this request.

Confirm the connection before continuing

After initialize, call the tool below with Mcp-Method: tools/call and the other MCP headers. It uses only the authorized identity, without running an agent, generating content, or changing data:

JSON
{
  "jsonrpc": "2.0",
  "id": 3,
  "method": "tools/call",
  "params": {
    "name": "logcomex_connection_status",
    "arguments": {
      "expected": {
        "mcpServer": "https://platform.logcomex.ai/mcp",
        "userId": "00000000-0000-4000-8000-000000000002",
        "tenantId": "00000000-0000-4000-8000-000000000001"
      }
    }
  }
}

The structured result keeps platform: logcomex.ai, version: v2, connectionStatus: connected, mcpServer, userId, tenantId, tenantName, and scopes from the actual bearer identity. Pass exactly next.verifyConnection.arguments: its expected object contains the same three values as next.verifyConnection.expected. verificationStatus: matched confirms the match; mismatch requires stopping the task. Follow nextAction in the AI client: reauthorize means switch accounts or reauthorize the same correct connector; connect_correct_server means select the connector with the exact URL. nextAction: none requests no connection action. Without expected values, {} remains valid and returns verificationStatus: not_requested; confirm the identity with the person. Creating or switching an account in the browser does not replace an existing connection's bearer. This read-only check does not switch accounts, disconnect, or revoke credentials. After authorization through the client, repeat verification with the handoff arguments and resume the request only with matched. If the tool is unavailable, check the URL and refresh catalog discovery before continuing; its absence does not prove another connector is needed.

To renew access, send a form to token_endpoint with grant_type=refresh_token, client_id, refresh_token, and the same resource. The refresh token rotates: save the new one atomically and avoid concurrent renewals. Expiration, revocation, or changes in access may require new authorization from the person.

Keep credentials in protected storage, never in code, URLs, Git, or logs. The current flow uses access delegated by the person and scoped to the workspace; client_credentials and service accounts are not part of this signup flow.

6. Direct shipment tracking

MCP also provides tracking, shipment queries, and a control tower as structured data, without creating an agent run. Discover the tools and their arguments through tools/list.

ToolScopeUse
logcomex_track_shipmenttracking:writeTrack a document; may register a shipment and consume quota.
logcomex_get_shipment_trackingtracking:readRead the saved state using the shipment's token.
logcomex_list_shipmentstracking:readList saved shipments with filters and pagination.
logcomex_get_tracking_control_towertracking:readQuery KPIs, alerts, distributions, coverage, and map data.

Request tracking:read tracking:write to register and monitor shipments, or only tracking:read to query saved shipments. agents:read and agents:run do not replace these scopes. The official URL remains https://platform.logcomex.ai/mcp; there is no need to change the connector address. All six tracking and auto-pilot tools appear in tools/list, including on existing connections. Discovering a tool does not grant data access or authorize its execution. A call without the required scopes returns HTTP 403 with WWW-Authenticate: Bearer error="insufficient_scope" and the scopes needed for new authorization. The client must request those scopes at /oauth/authorize, using the same client_id, the same /mcp resource, and new PKCE, and present the new consent request to the person. The four scopes tracking:read, tracking:write, automations:read, and automations:write can be explicitly requested by previously registered clients. Omitting scope keeps the registration's default permissions; existing tokens and refresh_token do not gain permissions. Other scopes remain limited by the original registration. The person's permissions and the workspace's features continue to be checked.

logcomex_track_shipment accepts document_number (6 to 160 characters), optional document_type (container, bl, awb, or booking), and optional shipowner and modality. To register a new BL or booking, provide the carrier in shipowner. modality specifies importation or exportation; omitting it defaults to importation, recorded in defaults_applied. Send confirmed: true only when the person's request authorizes tracking/registering that document; OAuth consent does not replace authorization for the action. A request that already authorizes tracking does not need another confirmation.

Example of tools/call, after initialize, with Mcp-Method: tools/call and the other headers from the previous section. The document is illustrative; replace it with the requested one:

JSON
{
  "jsonrpc": "2.0",
  "id": 10,
  "method": "tools/call",
  "params": {
    "name": "logcomex_track_shipment",
    "arguments": {
      "document_number": "ABCD1234567",
      "document_type": "container",
      "confirmed": true
    },
    "_meta": {
      "io.modelcontextprotocol/protocolVersion": "2026-07-28",
      "io.modelcontextprotocol/clientCapabilities": {}
    }
  }
}

Read data from result.structuredContent and handle result.isError and JSON-RPC errors. Optional fields without a value may be omitted. Registration is idempotent by workspace, tracking connection, type, and normalized document; preserve these values when retrying, without inventing an idempotency_key. Check success, action, write_performed, and synchronized. action: pending or registered_refresh_pending and synchronized: false require monitoring the state; do not present partial data as complete. Save the shipment's token and use the read tool. If there is no token yet, find the document in the listing before continuing. This identifier is not an OAuth credential.

Existing shipments can be updated by logcomex_track_shipment, with action: refreshed, when the person authorizes tracking or an update. review_required calls for reviewing or reconciling the existing registration; do not try to create another registration to bypass this state.

In the following examples, use the same JSON-RPC envelope and _meta, changing params.name and params.arguments:

JSON
{
  "name": "logcomex_get_shipment_tracking",
  "arguments": {"token": "TOKEN_RECEBIDO_DO_EMBARQUE"}
}

The read returns source: synchronized_workspace and does not force a provider refresh or register another shipment. read_at is the time of the read; shipment.last_synced_at, last_webhook_received_at, and event dates indicate how current the data is. Repeating the read does not speed up collection.

shipment.timeline contains recent synchronized events: timeline_scope: latest_synchronized_events and timeline_order: newest_first. Current normalization stores up to 30 recent events, from newest to oldest. timeline_truncated indicates additional truncation in MCP; false does not guarantee the complete history. The route has up to 200 points and may be reduced to fit the response, preserving its endpoints; check route.path_truncated. Keep missing data visibly missing when presenting it to the user.

JSON
{
  "name": "logcomex_list_shipments",
  "arguments": {
    "include_archived": false,
    "limit": 50,
    "offset": 0,
    "sort_by": "updated_at",
    "sort_direction": "desc",
    "since": "2026-10-27T00:00:00-03:00"
  }
}

search, modal (maritime, air, road), and include_archived (default false) filter the saved shipments. The listing also includes pending and failed registrations for reconciliation. limit accepts 1 to 50 items, default 20; advance using next_offset until the field is no longer returned, keeping the filters. offset ranges from 0 to 1,000,000. sort_by accepts created_at or updated_at (default); sort_direction accepts asc or desc (default). since requires an ISO timestamp with a timezone and is inclusive on the field selected in sort_by, before pagination. Use created_at for new registrations and updated_at for record updates. During synchronization, deduplicate by token and consider overlapping date windows because the saved shipments can change between pages.

A response may contain fewer items than limit to fit the size limit. This does not mean the end of the listing: use the returned next_offset, which accounts for the items sent. Do not add limit to the offset yourself, as that can skip records.

JSON
{
  "name": "logcomex_get_tracking_control_tower",
  "arguments": {"recent_limit": 10}
}

In the control tower, modal accepts maritime, air, or road; direction accepts import or export; situation accepts in_transit, delayed, arrived, attention, updated, stale, or failed. All are optional. recent_limit accepts 1 to 50, default 8. Indicators reflect accessible shipments and saved data, without running an agent or generating a dashboard.

Display coverage.loaded, total, complete, source_loaded, source_total, and aggregate_available. source_loaded/source_total describe coverage of the source set used for filtering; filtered_total_known indicates whether the total for the filtered set is known. With a filter, an incomplete source set, and no available aggregate, coverage.total may be null or omitted and kpis.total may be null: this does not mean zero shipments.

coverage.kpis_scope distinguishes complete_filtered_workspace from loaded_shipments. coverage.rich_sections_scope: loaded_shipments limits detailed sections to the loaded shipments; consider lead_time_samples and quality_samples. Do not extrapolate sample indicators to all saved shipments.

The map has up to 60 shipments and 64 points per route; alerts are limited to 30 and routes to 8. The size limit may reduce these sets. Check truncated_sections, map.truncated, and path_truncated; route reductions preserve their endpoints. Do not interpret missing coordinates or a partial response as complete coverage. Recent items and the map do not replace the paginated listing.

Respect quota and authorization errors. For pending states, use reads with an interval between requests; do not repeat registrations for polling. If a registration call has an uncertain outcome, preserve the document and type when retrying.

7. Company tracking auto-pilot

auto-pilot creates a recurring automation for maritime Shipment Intel Brasil data by CNPJ or exact name and registers tracking for the containers found. Creation queues the first run and returns run.status: queued; results are queried afterward, without an agent or LLM. The tool name is exactly auto-pilot.

Availability depends on updating the executors in the environment. Before that, create or resume returns tracking_autopilot_rollout_required; reading and pausing remain available. In MCP, check result.isError and the error JSON in result.content[].text, even with HTTP 200. Wait for availability without repeating registrations.

OperationScopes
auto-pilot, action: create or resumeautomations:write market-intelligence:read tracking:write
auto-pilot, action: pauseautomations:write
logcomex_get_tracking_auto_pilotautomations:read market-intelligence:read tracking:read

Existing clients can explicitly request the new automation and tracking scopes with the same client_id, with renewed consent, keeping https://platform.logcomex.ai/mcp. market-intelligence:read remains subject to the original registration. Refresh tools/list to see the tools; execution without permission returns HTTP 403 with the scopes required to reauthorize. refresh_token does not expand permissions. Workspace authorization and quotas continue to be checked; management requires the creator or an administrator.

Use these objects as params in the tools/call envelope shown above, preserving _meta. The examples are illustrative; replace the company only after explicit authorization to schedule recurring tracking. confirmed: true represents that authorization, including the schedule and quota consumption.

JSON
{
  "name": "auto-pilot",
  "arguments": {
    "action": "create",
    "confirmed": true,
    "name": "Tracking da empresa exemplo",
    "idempotency_key": "tracking-empresa-exemplo-20261027",
    "configuration": {
      "company": {"kind": "cnpj", "value": "01234567000189", "role": "brazilian_company"},
      "directions": ["import", "export"],
      "lookback_days": 30,
      "max_shipments_per_run": 100
    },
    "schedule": {"frequency": "daily", "time": "08:00", "timezone": "America/Sao_Paulo"}
  }
}

company.kind accepts a full cnpj as text or an exact name. Names are compared after normalizing whitespace and case; there is no prefix or approximate search. Ambiguity between company codes is rejected. role: brazilian_company selects the consignee for imports and the shipper for exports; shipper and consignee select explicit roles when supported by the source. The fields correspond to cdshipper/txshipper and cdconsignatario/nmconsignatario in sources that provide them. Do not send these legacy names as arbitrary arguments.

directions accepts import and/or export, with both as the default. lookback_days accepts 1–365, default 30; max_shipments_per_run accepts 1–500, default 100. Data depends on source fields and coverage. The per-run limit is not the company's total number of shipments.

If schedule is omitted, the schedule is daily at 08:00 in America/Sao_Paulo; disclose this before confirmation. frequency accepts daily, weekly, or monthly, time uses HH:MM, and timezone uses IANA names. Weekly schedules require weekdays without duplicates (mon through sun); monthly schedules require monthday from 1 to 28. These fields must only appear for their corresponding frequency.

Creation requires an idempotency_key of 8–128 characters (letters, numbers, period, underscore, colon, or hyphen). Reuse the key and the same data if the response is lost; reused: true indicates reuse. The same key with a different configuration causes a conflict. Do not create another schedule for polling.

JSON
{
  "name": "logcomex_get_tracking_auto_pilot",
  "arguments": {
    "automation_id": "11111111-1111-4111-8111-111111111111",
    "run_id": "22222222-2222-4222-8222-222222222222",
    "limit": 20,
    "offset": 0
  }
}

Save the returned automation.id and run.id. Without run_id, the read selects the latest run; keep the identifier fixed while paginating. limit accepts 1–50, default 20; offset accepts 0–500. Follow the returned next_offset, even when fewer items than the limit are returned. This query never registers containers, updates tracking, or queries Shipment Intel again.

items returns container, navio, dtoperacao, armador, direction, tracking_token, status, action, tracking_reused, and error_code, as well as source_id. dtoperacao is the operation date in the source, not ETA. total counts results saved in this run so far and may grow. processing_complete indicates processing has ended; check run.status, because it also applies to failures, cancellations, and skipped runs.

Tracking identifies the container (coverage.tracking_identity: container). tracking_reused: true means an existing registration was reused, counted in coverage.reused_container_results. Different voyages of a container may share that registration; independent tracking per voyage is not guaranteed. Show the reuse alongside the result.

Individual states are pending, processing, tracked, synchronization_pending, review_required, failed, or skipped. Pending synchronization does not mean a lost registration; save tracking_token and pass it as token to logcomex_get_shipment_tracking to query the saved operational state. Do not register again to bypass review_required.

Display coverage.complete, truncated, reason, limit_reason, the window_start/window_end window, the as_of reference, and query counts, including captured_count and pages_scanned. limit_reason: page_limit indicates truncation by page count. A completed run may have partial coverage or failed items. The result does not necessarily represent all of the company's shipments; missing source data must not become invented values.

coverage.identity reports role, kind, code_available, name_identity_verified, and identity_code_type (cnpj or source_identifier) for each direction, without resolved values. consistency: live_offset_pagination indicates live data between pages, with no transactional snapshot guarantee. The configuration is immutable, including through REST; the name and state remain editable according to permissions.

JSON
{
  "name": "auto-pilot",
  "arguments": {
    "action": "pause",
    "automation_id": "11111111-1111-4111-8111-111111111111",
    "confirmed": true
  }
}

To resume, use action: resume. Pause and resume accept only action, automation_id, and confirmed. Pausing prevents new triggers and registrations; a request already sent to the provider may complete. Pause remains available with automations:write even without data scopes. automation.url opens the configuration and history in the platform, with pause/resume controls. The configuration is read-only; to change the company, data selection, or schedule, create another authorized automation and pause the previous one.

8. Product import overview before refinement

Use logcomex_run_agent as the entry point for product import requests. Preserve the requested description or NCM, period, and filters in prompt. An initial query with valid parameters can deliver the overview before refinement, including products described in text or broad NCM selections. Available fields, permissions, and source coverage determine what can be delivered; the presence of multiple attributes does not make refinement questions mandatory.

Executing the overview and completing the request are separate decisions. Requested comparisons, calculations, files, and other work continue in the same flow when the certified result does not cover them. Refinement is optional for adjusting an initial selection; saved refinement decisions and contexts remain preserved.

Example params for tools/call, retaining the envelope and headers from section 5:

{
  "name": "logcomex_run_agent",
  "arguments": {
    "prompt": "Importações brasileiras do NCM 85166000, de novembro de 2025 a outubro de 2026, sem filtros adicionais. Traga total FOB, os 12 meses e top 5 importadores.",
    "mentions": ["product_intelligence"],
    "idempotency_key": "ncm85166000-202511-202610-panorama"
  }
}

Poll logcomex_get_agent_run_status with the returned run_id. In the exact NCM example above, product_summary contains the query's certified figures: total_fob, monthly, ranking, breakdowns, attributes, and coverage. Broader overviews use response and published artifacts, according to available coverage. Use structured values when presenting tables and charts; the narrative does not replace the data.

Breakdowns show importer, country of origin, Brazilian state, entry location, and available attributes. An entry location may be a port, airport, or customs office; do not present it as a confirmed seaport. An unavailable or restricted dimension has status: unavailable, with no invented values.

share_pct is the percentage of the selection's total FOB. coverage_pct is the proportion of records with a value for the dimension; known_fob_share_pct shows how much FOB has a value. The leading categories are accompanied by other_fob/other_share_pct and the amounts without a value (missing_fob, missing_records). The overview includes up to five groups per dimension and eight attributes with up to five values each; counts and truncated explain the limits. Do not add different dimensions or attributes together.

For common dimensions, the displayed groups plus other_fob already sum to the total; missing_fob describes the portion without information within that sum. For attributes, the groups and other_fob cover only populated values, and missing_fob is the remaining portion.

Long values still count toward coverage and totals. label_truncated identifies abbreviated labels while preserving distinct identities; do not use an abbreviated label as an exact filter. Attributes with refinement_supported: false exceed the refinement input limits.

monthly preserves every month in the interval; the ranking limit does not shorten the series. A month with no records in the source has fob: 0, records: 0, and has_data: false. This does not prove an absence of trade outside the source. complete describes delivery of the queried aggregate, not universal coverage. Inconsistent results are not estimated.

Processing uses the agent's same OAuth permissions, column controls, admission, and auditing. There is no other public tool to select for this overview. Additional filters and saved refinement decisions remain preserved by the product flow.

9. Respond to refinement in chat or a form

When a run returns requires_input: true, present the questions in pending_inputs. The person may respond through the form available in the client or directly in the conversation. Send the response with logcomex_respond_to_input, using the interaction_id and copying version to expected_version from the pending question. Do not start another logcomex_run_agent to respond.

The panel may advance after the assistant's last tool result. Before repeating or answering an old question, refresh logcomex_get_agent_run_status with the existing logical_run_id (or run_id) as run_id; use only current pending_inputs. A terminal state closes earlier questions: use response and product_summary when available. Do not page through every artifact to reconstruct the summary; use logcomex_get_data_view_page for additional rows, requested details, or necessary data still missing. In compatible clients, silent synchronization updates the next turn without removing published text. Continue in chat requires a click and does not start another logcomex_run_agent.

For an unambiguous choice, send the option_ids returned in the question. For free text, preserve the person's words in answers[question_id].other when allow_other: true. Do not invent IDs or treat silence as an answer. If the text could refer to more than one question, clarify which question the person is answering.

Illustrative params example; replace the identifier, version, and q1 with the received values:

{
  "name": "logcomex_respond_to_input",
  "arguments": {
    "interaction_id": "00000000-0000-4000-8000-000000000003",
    "expected_version": 1,
    "action": "accept",
    "answers": {
      "q1": {"other": "Use 220 V e mantenha novembro/2025 a outubro/2026. Quero revisar a nova prévia."}
    },
    "idempotency_key": "resposta-recorte-001"
  }
}

Text in other refines the request; it does not confirm the selection or automatically generate the final analysis. For the explicit action to generate from the edited preview, send action: "accept", answers: {}, refinement_action: "generate", and the latest signed refinement_token from the same interaction and refinementId. Opening a preview does not authorize this action.

The response continues the linked run, preserving its origin, permissions, and saved results. Use the returned run_id to track the continuation. On transport failure, reuse the same key and response; on a version conflict, reread the state before responding to the updated question.

Account signup errors and retries

Signup errors have error and may include code and details. Check the HTTP status and body before proceeding.

HTTPHow to handle it
400Correct the format or required data. The application uses 400 for validation errors.
401Invalid or expired OTP. Request a new code by starting signup again.
403Signup is disabled, the decision expired, or access is pending. LOGCOMEX_REGISTRATION_MFA_REQUIRED requires normal login with MFA at /auth.
409The suggested workspace changed (SIGNUP_DOMAIN_CANDIDATE_CHANGED). Restart signup and obtain another decision.
422Data was rejected by a domain rule or the identity service. Correct the indicated fields.
429Too many attempts. Wait before trying again; do not retry in a loop.
502 / 503 / 504The service is temporarily unavailable or configuration is incomplete. Wait and check whether the previous step completed.

Example:

JSON
{
  "error": "Esta conta exige verificação em duas etapas. Entre normalmente para concluir o acesso.",
  "code": "LOGCOMEX_REGISTRATION_MFA_REQUIRED"
}

There is no general idempotency guarantee or documented support for Idempotency-Key in this flow. The provider may consume the OTP before a later step fails; the decision token is also single-use. In these cases, request a new code and repeat verification. An identity that is already linked is reused during provisioning to avoid creating another workspace for the same user.