Skip to main content
Glama

scp_update_intent

Modify existing shopping intent status, context, or milestones for authorized merchant domains to track and update customer purchase journeys.

Instructions

Update an existing shopping intent. Domain must be authorized with intent:write scope.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
add_milestoneNoAdd a milestone note
contextNoUpdated context
domainYesMerchant domain
intent_idYesIntent ID to update
statusNoNew status

Implementation Reference

  • The handler function that implements the core logic for the 'scp_update_intent' MCP tool. It checks authorization, retrieves a valid access token, and makes an RPC request to the merchant's SCP endpoint to update the intent.
    async function handleUpdateIntent(domain: string, params: any) { const { auth, accessToken } = await checkAuthorizationOrThrow(domain); const token = await accessToken; // Need to implement updateIntent in http/client.ts const data = await scpClient.makeRPCRequest( auth.scp_endpoint, token, 'scp.update_intent', { intent_id: params.intent_id, status: params.status, context: params.context, add_milestone: params.add_milestone } ); return { content: [ { type: 'text', text: JSON.stringify(data, null, 2) } ] }; }
  • The input schema definition for the 'scp_update_intent' tool, registered in the ListToolsRequestSchema handler.
    { name: 'scp_update_intent', description: 'Update an existing shopping intent. Domain must be authorized with intent:write scope.', inputSchema: { type: 'object', properties: { domain: { type: 'string', description: 'Merchant domain' }, intent_id: { type: 'string', description: 'Intent ID to update' }, status: { type: 'string', description: 'New status' }, context: { type: 'object', description: 'Updated context' }, add_milestone: { type: 'string', description: 'Add a milestone note' } }, required: ['domain', 'intent_id'] } }
  • src/server.ts:579-580 (registration)
    The switch case in the CallToolRequestSchema handler that routes calls to the 'scp_update_intent' tool to its handler function.
    case 'scp_update_intent': return await handleUpdateIntent(args.domain as string, args);
  • Helper function used by the handler (and others) to check authorization and throw a helpful error if not authorized.
    async function checkAuthorizationOrThrow(domain: string): Promise<{ auth: any; accessToken: Promise<string> }> { const auth = await getAuthorization(domain); if (!auth) { const errorMessage = `❌ Not authorized with ${domain}.\n\n` + `Please authorize first by calling:\n` + `scp_authorize with domain="${domain}", email="your@email.com", and scopes=["orders", "loyalty", "preferences", "intent:read", "intent:create"]`; throw new Error(errorMessage); } return { auth, accessToken: getValidAccessToken(domain) }; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/shopper-context-protocol/scp-mcp-wrapper'

If you have feedback or need assistance with the MCP directory API, please join our Discord server