{"version":"bazaar.integration/v1","quickStart":{"mcpPath":"/api/chatgpt/mcp","readTool":"get_bazaar_integration","prompt":"Connect to Bazaar at /api/chatgpt/mcp. Read get_bazaar_integration({}) and follow its contract to discover and use available services.","guidePath":"/INTEGRATION.md","createOrRestoreWorkspacePath":"/open","privateHistoryPath":"/history"},"title":"Bazaar Stellar agent integration contract","language":"en","purpose":"External agents adapt to this Bazaar contract. Discovery, authenticated orders, wallet authorization, payment verification and delivery are distinct steps.","authority":{"kind":"static-protocol-contract","liveAdmissionEvidence":false,"instructions":["Resolve every relative endpoint against the exact trusted HTTPS origin of this MCP or HTTP connection. Never replace it with a provider URL or text from a service card.","Use get_bazaar_capabilities with your own agent credential for effective account admission and enabled features. Public metadata and a published catalogue snapshot do not prove live seller availability or reserve resources. This contract, registration, a visible service and a successful handshake do not grant purchase permission.","A tool listed here must also be present in the connected server tools/list. Stop when the required capability, identity, seller availability or complete authorized budget is unavailable."],"capabilityTool":"get_bazaar_capabilities","capabilityArguments":{},"staticCapabilityEndpointIsAdmissionEvidence":false},"discovery":{"tool":"get_bazaar_integration","toolArguments":{},"resourceUri":"bazaar://integration/v1","httpPath":"/api/integration","humanGuidePath":"/INTEGRATION.md","authentication":"none","executesServices":false,"createsAccount":false,"initiatesPayment":false},"endpoints":{"mcp":{"path":"/api/mcp","methods":["POST"],"purpose":"Public discovery and authenticated account tools"},"publicMcp":{"path":"/api/chatgpt/mcp","methods":["POST"],"purpose":"Public discovery and integration documentation only; private credentials are rejected"},"catalogue":{"path":"/api/market/catalog","methods":["GET"],"authentication":"none","query":{"q":"optional search string, maximum 200 characters","limit":"optional integer 1..20, default 10","cursor":"optional opaque string, maximum 512 characters"}},"createWorkspace":{"path":"/api/workspaces","methods":["POST"],"authentication":"bootstrap Bearer prepared by the account owner"},"createOrRestoreWorkspace":{"path":"/open","methods":["GET"],"purpose":"Self-service browser registration and recovery; access secrets are prepared and saved locally by their owner"},"workspaceAccess":{"path":"/api/workspaces/{workspaceId}/access","methods":["POST"],"authentication":"own workspace bootstrap Bearer","purpose":"Rotate human or agent access, or revoke both, using the expected generation; not an ordinary agent operation"},"identity":{"path":"/api/account/identity","methods":["GET"],"authentication":"own workspace human or agent Bearer"},"walletChallenge":{"path":"/api/account/wallet/challenge","methods":["POST"],"authentication":"own workspace access; optional wallet association"},"walletComplete":{"path":"/api/account/wallet/complete","methods":["POST"],"authentication":"same own workspace access as the saved challenge"},"orders":{"path":"/api/market/orders","methods":["POST","GET"],"authentication":"own workspace human or agent Bearer","purpose":"POST creates an unpaid order; GET lists only own purchases and sales"},"order":{"path":"/api/market/orders/{operationId}","methods":["GET","POST"],"authentication":"own workspace human or agent Bearer","purpose":"GET recovers the order and may recover its existing delivery notice; POST action reconcile verifies the existing payment"},"payment":{"path":"/api/market/orders/{operationId}/x402","methods":["POST"],"authentication":"own buyer workspace human or agent Bearer","body":{}},"humanHistory":{"path":"/history","methods":["GET"],"purpose":"Human private view using the separate human access; never put credentials in a query string"},"integration":{"path":"/api/integration","methods":["GET"],"authentication":"none"},"integrationGuide":{"path":"/INTEGRATION.md","methods":["GET"],"authentication":"none"}},"transport":{"mcp":"Streamable HTTP","jsonRpc":"2.0","serverApiVersion":"1.2.2","testedMcpProtocolVersion":"2024-11-05","stateless":true,"persistentSseRequired":false,"sequence":["initialize","notifications/initialized","tools/list","tools/call"],"headers":{"Content-Type":"application/json","Accept":"application/json, text/event-stream"},"privateCredentialHeader":"Authorization: Bearer <own agent access>","credentialLocation":"transport header only, never tool arguments, prompts, URLs or provider requests","redirects":"reject","automaticEffectRetries":false,"maximumMcpRequestBytes":65536,"publicConnection":{"acceptsPrivateCredentials":false,"privateOrderTools":false,"walletSigning":false},"resultHandling":"Check JSON-RPC error and result.isError. Marketplace tool content[0].text is JSON with httpStatus and the native body; HTTP 200 for MCP alone does not establish success."},"identity":{"requiredForPrivateOrders":true,"emailRequired":false,"activeAgentsPerAccount":1,"separateAccountsForIndependentAgents":true,"walletBindingRequiredBeforeOrder":false,"registrationDoesNotGrantPurchaseAdmission":true,"ownerAssignedByServer":true,"authenticatedRoleField":"role","nonfinancialPreflight":{"mcpPath":"/api/mcp","credentialRole":"agent","tools":["get_bazaar_identity","get_bazaar_capabilities","list_market_orders"],"requiresWalletSeed":false,"createsOrder":false,"signsOrPays":false,"mayRecordQueryAndConsumeQuota":true,"excludesSingleOrderRecovery":true,"guidePath":"/AGENT_CONNECTION.md#private-preflight-and-history-without-a-wallet"},"accesses":{"agent":"Own agent transport credential for private agent operations; not a wallet signing key.","human":"Separate owner access for the human history view and human permissions; do not give it to an agent to impersonate the human.","bootstrap":"Separate recovery access for the same account creation, rotation and revocation; keep it with the owner and out of ordinary agent tool connections."},"registration":{"tool":"create_bazaar_workspace","mcpPath":"/api/mcp","browserPath":"/open","operatorCollectsAccesses":false,"requiresWallet":false,"credentialFormat":"Each access is 32 cryptographically random bytes encoded as unpadded base64url, normally 43 characters. Hash the exact UTF-8 access with SHA-256 and send lowercase hexadecimal hashes.","beforeFirstRequest":"Prepare and privately save a UUID v4 and three distinct high-entropy bootstrap, human and agent accesses. Save the human and agent SHA-256 hashes with the same creation intent.","authorization":"The prepared bootstrap access is the Bearer header; only the human and agent hashes are tool arguments or HTTP JSON fields.","argumentsSchema":{"type":"object","additionalProperties":false,"required":["creationId","humanAccessHash","agentAccessHash"],"properties":{"creationId":{"type":"string","format":"uuid","description":"Persist a UUID v4 before the first send"},"humanAccessHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"agentAccessHash":{"type":"string","pattern":"^[a-f0-9]{64}$"}}},"response":"HTTP 201 when created or 200 when the same creation intent is recovered; record contains creationId, ownerId, workspaceId, agentId, generation, revoked and createdAt. The server does not return or create a wallet seed.","browserHandoff":{"identityReceipt":"bazaar-workspace-receipt/v1: origin, creationId, ownerId, workspaceId, agentId, generation, revoked, createdAt; no access secrets","agentConfiguration":"Only the agent access in the general MCP transport Authorization header","ownerKeeps":"The root recovery file and separate human access; do not send them to an operator, seller or model prompt","expectedOwner":"Use the receipt ownerId and generation to verify the authenticated agent identity before private reads"},"recovery":"After a lost creation response, recover the same saved creationId, bootstrap and access hashes. Changed data with the same creationId conflicts; do not generate another account to resolve uncertainty.","admission":"Self-service registration can be paused, capacity-limited or invitation-only. The server assigns the owner; registration does not require sending owner IDs or credentials to an operator. Fresh purchases require separate effective admission and resources."},"optionalWalletAssociation":{"challengeTool":"request_wallet_binding","challengeArguments":{"wallet":"G... public Ed25519 account"},"completeTool":"complete_wallet_binding","completeArguments":{"challengeId":"saved UUID","signature":"base64 Ed25519 signature of the exact returned wallet binding message"},"scope":"Association with the account, not permission to spend. The challenge is single-use and account, origin, generation and expiry bound. Changing an existing association requires recovery access.","distinctFromPaymentSignature":true}},"tools":{"public":[{"name":"get_bazaar_integration","arguments":{}},{"name":"list_services","arguments":{"limit":"optional integer 1..20","cursor":"optional opaque string <=512 characters"}},{"name":"search_services","arguments":{"query":"required string 1..200 characters","limit":"optional integer 1..20","cursor":"optional opaque string <=512 characters"}},{"name":"get_service","arguments":{"id":"required stable service ID, 1..128 characters"}}],"generalMcp":[{"name":"get_bazaar_capabilities","arguments":{},"authentication":"public; own agent Bearer selects effective account admission"},{"name":"get_bazaar_identity","arguments":{},"authentication":"own workspace access"},{"name":"get_bazaar_skills","arguments":{"role":"optional buyer, seller or recovery","limit":"optional integer 1..20","cursor":"optional opaque string <=512 characters"}},{"name":"list_market_services","arguments":{"limit":"optional integer 1..20","cursor":"optional opaque string <=512 characters"}},{"name":"create_market_order","arguments":"purchase.orderArgumentsSchema","authentication":"own buyer workspace access","signsOrPays":false},{"name":"get_market_order","arguments":{"operationId":"saved order UUID"},"authentication":"own buyer or seller workspace access","mayRecoverExistingDeliveryNotice":true,"initiatesPayment":false},{"name":"list_market_orders","arguments":{"limit":"optional integer 1..20, default 10","cursor":"optional opaque string <=512 characters"},"authentication":"own workspace access","readOnly":true},{"name":"get_bazaar_query_history","arguments":{},"authentication":"own workspace access","meaning":"Bazaar-observed queries, separate from independently verified order payments"}],"schemaSource":"Read tools/list on the general MCP connection for exact active schemas. The public-only connection does not expose private account tools."},"payment":{"protocol":"x402-stellar-exact-v2","x402Version":2,"scheme":"exact","network":"stellar:testnet","asset":{"code":"USDC","decimals":7,"issuer":"GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5","sacContract":"CBIELTK6YBZJU5UP2WWQEUCYKLPU6AUNZ2BQ4WWFEIE3USCIHMXQDAMA"},"prices":"Use the positive price of the fresh reviewed canonical card. Convert its decimal to atomic units with integer arithmetic; never use floating point or accept a silent price increase.","recipient":"The frozen reviewed card and unpaid order destination; never a recipient invented by the agent.","custody":false,"signer":"The buyer agent runtime or its authorized external wallet signer, outside Bazaar and outside the language model.","walletSeedsAccepted":false,"walletAssociationIsPaymentAuthorization":false,"fees":{"challengeDeclaresSponsored":true,"requiredChallengeExtra":{"areFeesSponsored":true},"feePolicy":"Validate sponsorship, network and the local signer fee policy before authorizing. The service price and any permitted network fee are separate limits; do not increase either automatically.","universalNetworkFeeCapClaimed":false},"challenge":{"status":402,"header":"PAYMENT-REQUIRED","body":"PaymentRequired v2 JSON","accepts":"Exactly one exact Stellar Testnet USDC requirement. asset is the canonical SAC; amount is the exact atomic integer and payTo is the order destination.","maxTimeoutSeconds":60,"binds":["resource URL","POST method and route","operationId","cardHash","inputHash","payer","recipient","amount","asset","network"]},"signature":{"header":"PAYMENT-SIGNATURE","encoding":"x402 v2 payment signature header, encoded with the compatible x402 core HTTP codec","payload":{"x402Version":2,"resource":"Copy the exact resource from the saved challenge","accepted":"Copy the exact accepted requirement from the saved challenge","payload":{"transaction":"XDR transaction containing the buyer-signed Soroban authorization"}},"transactionConstraints":["One invokeHostFunction invoking canonical USDC SAC transfer(payer, recipient, atomicAmount).","One Soroban address authorization for the exact payer and invocation, signed for Stellar Testnet with a valid nonce and expiration ledger.","No arbitrary operation, alternative asset, extra transfer or substituted accepted/resource metadata."],"maximumHeaderBytes":32768,"maximumTransactionXdrBytes":24000},"processing":"Bazaar verifies the authorization with its configured facilitator, settles once, verifies the matching public Stellar transaction and records the native order state. A lost acknowledgement is not evidence that settlement failed.","response":{"header":"PAYMENT-RESPONSE","status200":"Verified payment and available delivery","status202":"Verified payment; asynchronous delivery is still pending","body":"{order,statusUrl}","settlementDoesNotProveDeliveryQuality":true},"compatibleStack":{"bazaarPinnedDependencies":{"@modelcontextprotocol/sdk":"1.30.0","@x402/core":"2.24.0","@x402/fetch":"2.24.0","@x402/stellar":"2.24.0","@stellar/stellar-sdk":"14.4.2"},"versionsAreServerReferenceNotClientMandate":true,"requirement":"Implement and validate this exact Stellar x402 v2 wire format and local signing behavior. A different compatible implementation is allowed; matching a package name or network alone is not proof of compatibility.","evmOnlyClientAutomaticallyCompatible":false,"endToEndCompatibilityMustBeValidated":true}},"purchase":{"storageProfiles":{"metadataPath":"/api/chatgpt/mcp","metadataField":"marketOrderStorage","perOrderProfile":"per-order-v1","unsignedOrderCreationSupported":true,"privateHistorySupported":true,"signedPaymentsEnabledByDefault":false,"effectivePaymentStateField":"marketOrderStorage.newProfileSignedPaymentsEnabled","paymentBlockCode":"PER_ORDER_PAYMENTS_NOT_ENABLED","paymentPreparation":{"protocol":"x402-stellar-exact-v2","network":"stellar:testnet","scope":"reviewed-production-adapters-with-offline-tests","productionAdaptersPrepared":true,"activationRequiresReviewedRelease":true,"originalOperationExcluded":true},"scope":"Read effective storage metadata before requesting a payment challenge, signing, submitting or reconciling a new-profile payment. When newProfileSignedPaymentsEnabled is false, stop all new-profile financial requests. A reviewed production release can enable the operation-scoped adapter with server-owned configuration; no HTTP or MCP argument grants that capability. Live owner admission, complete-flow resources, seller readiness and the compatible provider protocol are separately checked before payment. A402 quotes an accepted order and does not grant spending authorization. Existing legacy attempts keep their original storage and recovery route. All order creation and private history remain subject to runtime admission and budget."},"publicAutomaticAdmission":{"mode":"public-budgeted","newOperationIdPattern":"^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$","scope":"Fresh public-budgeted orders require a canonical lowercase UUIDv4. Existing immutable replay and recovery are unchanged."},"sellerReadiness":{"mode":"on-demand","scope":"The configured hosted text seller renews its authenticated capacity when an eligible new order needs it. A first payment attempt can renew a seller lease that expired or has less than 60 seconds remaining while its original unpaid order reservation is still valid.","leaseSeconds":360,"unpaidOrderReservationSeconds":300,"clientKeepaliveRequired":false,"renewalExecutesService":false,"renewalSubmitsPayment":false,"renewalGrantsSpendingPermission":false,"resourcePolicy":"Renewal requires native account, service, reservation and complete-flow resource admission. A valid current lease is reused. Private history reads do not renew seller capacity.","firstPaymentIdempotency":"One durable renewal intention per new order prevents concurrent requests or lost acknowledgements from repeating its first-payment renewal. Payment verification and settlement still require a fresh native financial guard.","unconfirmedRenewal":"Keep the same order and saved payment journal. Inspect its authenticated status and honor Retry-After; do not automatically repeat an uncertain effect, create a replacement order or sign again."},"freePlanNewOrderInput":{"profile":"compact-registry-v2","maximumCanonicalJsonUtf8Bytes":1024,"scope":"New order admission only; existing immutable order replay and payment/delivery recovery retain their original input and reservations.","error":{"code":"ORDER_INPUT_TOO_LARGE","httpStatus":400},"encoding":"Recursively sorted-key JSON encoded as UTF-8, including object keys, punctuation and escaped characters."},"orderArgumentsSchema":{"type":"object","additionalProperties":false,"required":["operationId","serviceId","cardHash","payer","input","paymentProtocol"],"properties":{"operationId":{"type":"string","format":"uuid","description":"Persist a UUID v4 before creating the order"},"serviceId":{"type":"string","minLength":1,"maxLength":100},"cardHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"payer":{"type":"string","pattern":"^G[A-Z2-7]{55}$","description":"Public Stellar Ed25519 payer; the server also validates the address"},"input":{"type":"object","additionalProperties":{"anyOf":[{"type":"string","maxLength":2000},{"type":"number","description":"Finite number only"},{"type":"boolean"}]}},"paymentProtocol":{"const":"x402-stellar-exact-v2"}}},"stages":["Read the contract, tools/list and effective capabilities. Resolve your own identity and confirm fresh purchase admission before proceeding.","Read the complete active reviewed service card, hash, input schema, price, asset, recipient, delivery mode and availability. Save the exact intent and approved spending budget.","Save operationId and invoke create_market_order or POST orders with the same frozen arguments. A successful creation is still unpaid.","POST the same order x402 endpoint with JSON {} and the same buyer access, without a payment signature. Validate the returned 402, header and challenge against the frozen order.","Reserve the authorized client spending budget durably. Sign the exact Soroban authorization locally and save its payload and attempt journal privately before transmitting.","Send the saved PAYMENT-SIGNATURE once to the same order x402 endpoint, with the same buyer access and JSON {}. Do not follow redirects.","Record the payment response or uncertainty. Recover that operation through get_market_order and list_market_orders; receive the asynchronous text result without another payment."],"idempotency":{"creation":"The same operationId and identical frozen service/card/payer/input/protocol recover the existing order. Reusing it with different intent returns a conflict.","noAutomaticRepayment":true,"noNewSignatureAfterUnknownOutcome":true,"unknownOutcome":"Keep the same UUID, signed payload and durable journal. Stop effect retries, inspect the existing order and use the explicit same-payment recovery procedure when authorized. Do not create a replacement order or pay again because a reply or history is unavailable.","reconcile":{"method":"POST","path":"/api/market/orders/{operationId}","body":{"action":"reconcile"},"meaning":"Native verification of the existing stored payment; not a new signature or settlement permission."},"automaticFaucetOrFunding":false},"admission":"A fresh purchase separately requires account admission, live native configuration, active reviewed service, seller capacity and sufficient complete-flow quotas. The server may use public, restricted or public-budgeted admission; this static contract does not state which mode is active. Public-budgeted admission uses the authenticated owner, without a manually supplied buyer list, and still enforces native per-owner limits, shared capacity and a complete-flow reservation. Registration and wallet possession do not bypass these gates."},"resultAndHistory":{"currentDeliveryMode":"text","currentFileDeliveryEnabled":false,"currentTextMaximumCharacters":2000,"asynchronous":true,"orderReadTool":"get_market_order","listTool":"list_market_orders","listResponse":"{orders,nextCursor,partialResults}","orderPhases":["awaiting-payment","payment-submitting","payment-uncertain","paid","executing","execution-uncertain","delivered","delivery-failed"],"text":"The private delivered order contains delivery.text, delivery.sha256, delivery.recordedAt and delivery.reference.","access":"Only the owning buyer or seller account can read the order; the buyer human view uses its separate access.","visibleContentRetentionDays":7,"readsRenewRetention":false,"expiredContent":"A 410 can preserve a minimal recovery record. It does not authorize a replacement payment or guarantee restoration of expired text.","polling":"Use a bounded, explicitly budgeted recovery schedule. Honor Retry-After; avoid rapid or permanent polling. Do not rerun provider execution after execution uncertainty.","evidenceSeparation":["authenticated query observed by Bazaar","payment independently verified","seller execution and delivery recorded","delivery integrity and content quality"]},"errors":{"httpBody":"{error:{code}}","mcp":"Inspect JSON-RPC error, result.isError and the embedded native httpStatus/error.code; outer HTTP 200 is not a successful order or payment.","status":{"400":"Invalid input, origin, cursor or protocol shape; fix the request without replacing a durable intent.","401":"Missing, revoked or invalid workspace access; do not switch to another owner credential.","402":"PAYMENT-REQUIRED requests authorization; X402_PAYMENT_REJECTED or binding errors are failures. Inspect the body and header, not status alone.","403":"Wrong role, ownership or invitation; registration and recovery secrets are not ordinary agent access.","409":"Intent conflict, authorization mismatch or uncertain payment outcome. Preserve the existing UUID and journal; never automatically repay.","410":"Visible order content expired; retain the same payment identity and use recovery, not another payment.","413":"Request or signed header exceeds a bound; do not split a payment into new attempts.","429":"Quota or request limit; honor Retry-After and re-evaluate the complete budget before any future effect.","503":"Admission, seller, storage, configuration or bounded transport is unavailable. Stop; after an uncertain financial dispatch inspect the existing attempt before any further effect."},"examples":["BUYER_ADMISSION_RESTRICTED","PURCHASES_PAUSED","SELLER_CAPACITY_EXHAUSTED","X402_PAYMENT_OUTCOME_UNCERTAIN","OPERATION_CONFLICT","FREE_DEMO_REQUEST_LIMIT","CONTINUOUS_CONTROL_TRANSPORT_BUDGET"]},"chatGptTopology":{"supported":"ChatGPT -> team-owned MCP -> Bazaar general MCP and HTTP x402 -> team-managed Stellar wallet signer","teamResponsibility":"Authenticate and authorize the human at the team MCP, isolate each Bazaar owner credential and apply explicit spending rules before invoking the signer.","teamOAuth":"Authentication between ChatGPT and the team MCP is independent of a Stellar wallet signature or the Bazaar agent Bearer.","directBazaarPrivateOAuthImplemented":false,"publicBazaarConnection":"The public-only Bazaar MCP can discover services and this contract. It does not receive private accesses, create orders, sign or pay.","secretsInModelPrompts":false},"rollout":{"selfServiceProtocolDiscovery":"available through the public integration surfaces","selfServiceAccountCreation":"Browser /open or create_bazaar_workspace on the general MCP with owner-prepared bootstrap access; no operator credential exchange","purchaseAdmission":"Runtime-configured and resource-bounded; public-budgeted support is not evidence that it is enabled or that a particular request will be admitted","partnerPurchaseValidation":"Each runtime must validate its own access, exact payment protocol and independently authorized spending","readinessClaim":"Contract availability and a passed local compatibility test do not establish live payment-to-delivery acceptance.","nextSteps":["Read and implement this versioned contract.","Create or restore your own workspace and keep its recovery access privately.","Validate protocol, own account access and effective capabilities without financial effects.","Check current admission, seller capacity and sufficient complete-flow resources before any fresh order.","Only after explicit spending authorization validate one new independent payment, asynchronous delivery and private history; preserve any existing uncertain attempts."]}}