Skip to main content
Glama

scp_create_intent

Create shopping intents with authorized merchants to define customer purchase goals and enable personalized shopping assistance through the Shopper Context Protocol.

Instructions

Create a new shopping intent with a merchant. Domain must be authorized with intent:create scope.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ai_assistantNoName of the AI assistant
base_intentYesNatural language description of the shopping goal
contextNoAdditional context about the intent
domainYesMerchant domain
mechanismNoHow the intent was createdconversational_ai
visibilityNoWho can see this intentmerchant_only

Implementation Reference

  • The main handler function for the 'scp_create_intent' MCP tool. It validates authorization, retrieves the access token, constructs the request parameters, calls the SCP HTTP client to create the intent, and returns the result.
     * Tool handler: scp_create_intent
     */
    async function handleCreateIntent(domain: string, params: any) {
      const { auth, accessToken } = await checkAuthorizationOrThrow(domain);
      const token = await accessToken;
    
      const data = await scpClient.createIntent(auth.scp_endpoint, token, {
        base_intent: params.base_intent,
        mechanism: params.mechanism || 'conversational_ai',
        ai_assistant: params.ai_assistant,
        ai_session_id: params.ai_session_id,
        context: params.context,
        visibility: params.visibility || 'merchant_only',
        expires_at: params.expires_at
      });
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(data, null, 2)
          }
        ]
      };
    }
  • The input schema definition and description for the 'scp_create_intent' tool, registered in the ListTools response.
    {
      name: 'scp_create_intent',
      description: 'Create a new shopping intent with a merchant. Domain must be authorized with intent:create scope.',
      inputSchema: {
        type: 'object',
        properties: {
          domain: {
            type: 'string',
            description: 'Merchant domain'
          },
          base_intent: {
            type: 'string',
            description: 'Natural language description of the shopping goal'
          },
          context: {
            type: 'object',
            description: 'Additional context about the intent'
          },
          mechanism: {
            type: 'string',
            description: 'How the intent was created',
            default: 'conversational_ai'
          },
          ai_assistant: {
            type: 'string',
            description: 'Name of the AI assistant'
          },
          visibility: {
            type: 'string',
            description: 'Who can see this intent',
            enum: ['merchant_only', 'shared_with_customer'],
            default: 'merchant_only'
          }
        },
        required: ['domain', 'base_intent']
      }
    },
  • src/server.ts:576-577 (registration)
    The switch case in the CallToolRequestSchema handler that routes calls to the scp_create_intent tool to its handler function.
    case 'scp_create_intent':
      return await handleCreateIntent(args.domain as string, args);

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