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); }

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