Skip to main content
Glama

scp_get_intents

Retrieve shopping intents from authorized merchant domains to understand customer purchase goals and preferences for personalized e-commerce assistance.

Instructions

Get shopping intents from a merchant. Domain must be authorized first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainYesMerchant domain
limitNoMaximum number of intents to return
statusNoFilter by status (e.g., ['active', 'in_progress'])

Implementation Reference

  • Main execution handler for scp_get_intents tool. Checks authorization, fetches access token, calls SCP client to retrieve shopping intents, and returns JSON-formatted response.
    async function handleGetIntents(domain: string, params: any) {
      const { auth, accessToken } = await checkAuthorizationOrThrow(domain);
      const token = await accessToken;
    
      const data = await scpClient.getIntents(auth.scp_endpoint, token, {
        status: params.status || ['active', 'in_progress'],
        limit: params.limit || 10,
        offset: params.offset || 0
      });
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(data, null, 2)
          }
        ]
      };
    }
  • Input schema and metadata for the scp_get_intents tool, defining required 'domain' and optional 'status' and 'limit' parameters.
    {
      name: 'scp_get_intents',
      description: 'Get shopping intents from a merchant. Domain must be authorized first.',
      inputSchema: {
        type: 'object',
        properties: {
          domain: {
            type: 'string',
            description: 'Merchant domain'
          },
          status: {
            type: 'array',
            items: { type: 'string' },
            description: 'Filter by status (e.g., [\'active\', \'in_progress\'])'
          },
          limit: {
            type: 'number',
            description: 'Maximum number of intents to return',
            default: 10
          }
        },
        required: ['domain']
      }
    },
  • src/server.ts:573-575 (registration)
    Tool handler registration in the CallToolRequestSchema switch statement, mapping tool name to handleGetIntents function.
    case 'scp_get_intents':
      return await handleGetIntents(args.domain as string, args);
  • Shared authorization check helper function used by the handler to ensure the domain is authorized before accessing data.
    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)
      };
    }
  • HTTP client helper that wraps the JSON-RPC call to the merchant's SCP endpoint for fetching intents.
    export async function getIntents(
      endpoint: string,
      accessToken: string,
      params?: {
        status?: string[];
        mechanism?: string;
        limit?: number;
        offset?: number;
      }
    ): Promise<any> {
      return makeRPCRequest(endpoint, accessToken, 'scp.get_intents', params);
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions the authorization prerequisite, which is useful, but doesn't cover other aspects like rate limits, error handling, pagination, or what 'shopping intents' entail. For a read operation with no annotation coverage, this leaves significant gaps in understanding the tool's behavior.

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 two sentences, front-loaded with the core purpose and followed by a key prerequisite. Every word serves a purpose, with no redundancy or unnecessary elaboration, making it highly efficient 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?

Given the tool's complexity (retrieving merchant data with filtering), lack of annotations, and no output schema, the description is incomplete. It mentions authorization but omits details on return format, error cases, or how 'shopping intents' are defined. This leaves the agent with insufficient context for reliable use.

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%, meaning all parameters are documented in the schema. The description doesn't add any parameter-specific details beyond what's in the schema (e.g., it doesn't explain 'domain' authorization further or 'status' values). With high schema coverage, the baseline score of 3 is appropriate as the description doesn't compensate but also doesn't detract.

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 action ('Get shopping intents') and resource ('from a merchant'), making the purpose understandable. However, it doesn't explicitly differentiate this tool from sibling tools like 'scp_get_offers' or 'scp_get_orders', which might also retrieve merchant data, so it lacks full sibling distinction.

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 first', implying a prerequisite. However, it doesn't specify when to use this tool versus alternatives like 'scp_get_offers' or 'scp_get_orders', nor does it mention any exclusions or detailed scenarios for use.

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