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)
      };
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions the authorization requirement ('Domain must be authorized with intent:write scope'), which is useful context about permissions. However, it doesn't describe what 'update' entails (e.g., partial vs. full updates, validation rules, error handling, or side effects), leaving significant gaps for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core action ('Update an existing shopping intent') and includes essential authorization context. Every word earns its place with zero waste, making it highly concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with no annotations and no output schema, the description is incomplete. It covers the authorization prerequisite but lacks details on behavioral aspects (e.g., what happens on update, response format, error conditions). Given the complexity of updating an intent with multiple parameters, more context is needed to adequately guide an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all 5 parameters thoroughly. The description adds no additional parameter semantics beyond what's in the schema (e.g., it doesn't explain relationships between parameters or provide examples). This meets the baseline of 3 when schema coverage is high.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Update') and resource ('existing shopping intent'), making the purpose unambiguous. It distinguishes from siblings like scp_create_intent by specifying 'existing' intent, but doesn't explicitly differentiate from other potential update operations. The domain authorization requirement adds specificity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides some usage context by stating 'Domain must be authorized with intent:write scope,' which implies when to use (after authorization) and prerequisites. However, it doesn't explicitly guide when to choose this tool versus alternatives like scp_create_intent or how it differs from other update-related operations. The guidance is implied rather than explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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