publ betaReference (MCP guide)
Open publ console

publ Reference

Migration map.

channel_context_get — confirm a selected channel context

Read one channel with its own stored credential before using channel workflows. Select its code from channels_list, or use the exact channel code bound to an already authorized hosted resource. This call does not select a shared global current channel.

Input

Field Type Required Constraint
channelCode string Yes Nonempty; runtime validation also rejects . and ...

The object is strict and accepts no account ID, channel ID, token, or password. null is invalid.

{"channelCode":"selected-channel-code"}

Replace the illustrative value with the actual returned or authorized code. Each subsequent channel tool still requires its own channelCode.

Processing and result

The HTTP adapter uses the selected channel bearer for GET /seller/api/v1/channels/{channelCode}. It does not fall back to the account bearer or add a channel-ID header to this detail request. The returned channel code must equal the requested code.

A successful payload contains:

Field Meaning
status, code success, CHANNEL_CONTEXT.
taskType channel-directory; a read classification, not a recoverable job type.
channel id, channelCode, title, baseCurrency, and optional currentPlan.
role String from the selected token's seller claims, or null when they cannot be parsed.
permissions String array from those claims, or an empty array.
claimSource local-channel-token for HTTP, demo for the demo port.
environment Adapter environment label.
verification confirmed:true, method:channel_detail_with_target_credential, allWorkflowPermissionsVerified:false.
consoleUrl Selected channel's console home screen in non-demo results.
nextStep, note Explicit-target and permission guidance.

Role and permission fields are locally decoded descriptive claims; this decoding is not an independent signature verification. An empty permission array does not prove that no access exists. The detail request establishes only that the selected credential could read that matching channel. Each later workflow and the service must check its own permissions and current state. Tokens, login keys, and raw token claims are not returned.

Inputs

This tool takes no input fields.

Failures and next action

Code Meaning and response
CHANNEL_CREDENTIAL_MISSING The selected channel has no stored credential. Have a person repair the connection for the same environment and intended channel.
CHANNEL_CONTEXT_MISMATCH The returned channel differs from the requested target. Stop; do not adopt that response as the intended channel.
CHANNEL_RESPONSE_UNVERIFIED The detail response fails the expected contract. Do not infer target access from it.
Authentication, credential, or HTTP failure Follow the returned failure; the generic reconnect guidance does not mean that login solves every error.

Users connect through the configured hosted connection flow. A new connection identity can make existing saved jobs inaccessible. Never repair that by changing a job's stored identity or entering passwords/tokens in chat.

Effects and scope

This read does not refresh credentials, exchange a login key, emit a server analytics event, create a job, or modify channel state. It can be repeated after correcting the connection or target. In hosted mode it is available only on a selected-channel resource and its input code must exactly equal the bound resourceScope.channelCode. An account resource's channel list does not authorize a context call through that same resource.

Implementation: src/channel-directory.ts, src/publ-http.ts::readChannelConnection and channel, plus src/hosted/scope.ts.