Skip to main content
Glama

scp_revoke_authorization

Remove merchant authorization to access customer e-commerce data, protecting privacy by revoking data sharing permissions for specific domains.

Instructions

Revoke authorization with a merchant domain

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainYesMerchant domain

Implementation Reference

  • The main handler function that revokes authorization. It retrieves the existing authorization, attempts to revoke the token remotely if possible, deletes the local authorization data, and returns a success message.
    async function handleRevokeAuthorization(domain: string) {
      const auth = await getAuthorization(domain);
    
      if (!auth) {
        throw new Error(`No authorization found for ${domain}`);
      }
    
      // Try to revoke token on server
      try {
        const accessToken = await getValidAccessToken(domain);
        await revokeToken(auth.scp_endpoint, accessToken);
      } catch (error) {
        // Revocation failed, but still delete locally
      }
    
      // Delete local authorization
      await deleteAuthorization(domain);
    
      return {
        content: [
          {
            type: 'text',
            text: `✓ Revoked authorization for ${domain}`
          }
        ]
      };
    }
  • The input schema definition for the scp_revoke_authorization tool, specifying the required 'domain' parameter.
    {
      name: 'scp_revoke_authorization',
      description: 'Revoke authorization with a merchant domain',
      inputSchema: {
        type: 'object',
        properties: {
          domain: {
            type: 'string',
            description: 'Merchant domain'
          }
        },
        required: ['domain']
      }
    },
  • src/server.ts:555-556 (registration)
    The switch case in the CallToolRequestSchema handler that registers and dispatches calls to the revoke authorization handler.
    case 'scp_revoke_authorization':
      return await handleRevokeAuthorization(args.domain as string);

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