Skip to main content
Glama

scp_get_offers

Retrieve active personalized offers from authorized merchants using the Shopper Context Protocol to access customer e-commerce data with OAuth 2.0 authentication.

Instructions

Get active personalized offers from a merchant. Domain must be authorized first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
active_onlyNoOnly return active offers
domainYesMerchant domain

Implementation Reference

  • Main execution handler for scp_get_offers tool: validates authorization, retrieves access token, calls HTTP client to fetch offers via JSON-RPC, formats and returns response.
     * Tool handler: scp_get_offers
     */
    async function handleGetOffers(domain: string, params: any) {
      const { auth, accessToken } = await checkAuthorizationOrThrow(domain);
      const token = await accessToken;
    
      const data = await scpClient.getOffers(auth.scp_endpoint, token, {
        active_only: params.active_only !== false
      });
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(data, null, 2)
          }
        ]
      };
    }
  • Input schema definition for scp_get_offers tool, defining parameters like domain and active_only.
    name: 'scp_get_offers',
    description: 'Get active personalized offers from a merchant. Domain must be authorized first.',
    inputSchema: {
      type: 'object',
      properties: {
        domain: {
          type: 'string',
          description: 'Merchant domain'
        },
        active_only: {
          type: 'boolean',
          description: 'Only return active offers',
          default: true
        }
      },
      required: ['domain']
    }
  • src/server.ts:413-430 (registration)
    Registration of scp_get_offers tool in the ListTools response, advertised to MCP clients.
    {
      name: 'scp_get_offers',
      description: 'Get active personalized offers from a merchant. Domain must be authorized first.',
      inputSchema: {
        type: 'object',
        properties: {
          domain: {
            type: 'string',
            description: 'Merchant domain'
          },
          active_only: {
            type: 'boolean',
            description: 'Only return active offers',
            default: true
          }
        },
        required: ['domain']
      }
  • Dispatch case in CallToolRequest handler that routes to the specific tool handler.
    case 'scp_get_offers':
      return await handleGetOffers(args.domain as string, args);
  • Helper function in HTTP client that wraps the generic JSON-RPC request specifically for scp.get_offers method.
    export async function getOffers(
      endpoint: string,
      accessToken: string,
      params?: { active_only?: boolean }
    ): Promise<any> {
      return makeRPCRequest(endpoint, accessToken, 'scp.get_offers', 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 adds some context, but does not cover other important traits such as whether this is a read-only operation, potential rate limits, error handling, or what the return format looks like. For a tool with no annotations, this leaves significant gaps in understanding its 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 main purpose and followed by a prerequisite. Every sentence earns its place by providing essential information without redundancy or fluff, making it efficient and well-structured.

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

Completeness3/5

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

Given no annotations and no output schema, the description is incomplete for a tool that likely returns data (offers). It covers the purpose and a key prerequisite but lacks details on return values, error cases, or behavioral nuances. However, the schema coverage is high, and the description is concise, making it minimally adequate but with clear gaps.

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 both parameters (domain and active_only) adequately. The description adds minimal value beyond the schema by implying the domain parameter's role in authorization, but does not provide additional syntax or format details. This meets the baseline for high schema coverage.

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 'Get' and the resource 'active personalized offers from a merchant', specifying what the tool does. It distinguishes from siblings like scp_get_intents or scp_get_orders by focusing on offers, but does not explicitly contrast with them. The purpose is specific and actionable, though not fully differentiated from all siblings.

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

Usage Guidelines4/5

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

The description provides clear context for when to use this tool by stating 'Domain must be authorized first', implying a prerequisite. It does not explicitly mention when not to use it or name alternatives among siblings, but the context is sufficient for basic usage guidance without being misleading.

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