Skip to main content
Glama
recepgocmen

Blue Perfumery MCP Server

by recepgocmen

get_purchase_link

Retrieve the direct Shopier purchase link for a specific perfume by providing its unique ID, enabling quick access to fragrance transactions via Blue Perfumery's MCP server.

Instructions

Get the Shopier purchase link for a specific perfume

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe perfume ID

Implementation Reference

  • src/index.ts:81-94 (registration)
    Registration of the get_purchase_link tool including its name, description, and input schema (requires 'id' string).
    {
      name: "get_purchase_link",
      description: "Get the Shopier purchase link for a specific perfume",
      inputSchema: {
        type: "object",
        properties: {
          id: {
            type: "string",
            description: "The perfume ID",
          },
        },
        required: ["id"],
      },
    },
  • Implements the get_purchase_link tool: validates ID input, queries Product model for active perfume by ID, checks for shopierLink, returns JSON with link or error.
    case "get_purchase_link": {
      const { id } = args as { id: string };
      
      if (!id) {
        throw new McpError(
          ErrorCode.InvalidParams,
          "ID parameter is required"
        );
      }
    
      const perfume = await Product.findOne({ id, status: "active" }).lean();
      
      if (!perfume) {
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify({
                success: false,
                error: `Perfume with ID '${id}' not found`,
              }, null, 2),
            },
          ],
        };
      }
    
      if (!perfume.shopierLink) {
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify({
                success: false,
                error: `No purchase link available for '${perfume.name}'`,
              }, null, 2),
            },
          ],
        };
      }
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify({
              success: true,
              perfume: {
                id: perfume.id,
                name: perfume.name,
                brand: perfume.brand,
                price: perfume.price,
              },
              purchaseLink: perfume.shopierLink,
              message: `You can purchase ${perfume.name} from Blue Perfumery via Shopier`,
            }, null, 2),
          },
        ],
      };
    }
Install Server

Other Tools

Related 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/recepgocmen/blue-perfumery-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server