Skip to main content
Glama
tusharpatil2912

Pollinations Multimodal MCP Server

updateDomains

Modify allowlisted domains for user access control in the Pollinations Multimodal MCP Server to manage permitted content generation sources.

Instructions

Update domains allowlisted for a user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
userIdYesThe GitHub user ID
domainsYesThe domains to allowlist
sessionIdYesThe session ID for authentication

Implementation Reference

  • The main handler function for the 'updateDomains' tool. Validates inputs, makes a PUT request to the auth API to update the user's allowlisted domains using the provided JWT access token, and returns the response in MCP format.
    async function updateDomains(params) {
        const { userId, domains, accessToken } = params;
    
        if (!userId || typeof userId !== "string") {
            throw new Error("User ID is required and must be a string");
        }
    
        if (!Array.isArray(domains)) {
            throw new Error("Domains must be an array of strings");
        }
    
        if (!accessToken || typeof accessToken !== "string") {
            throw new Error("Access token is required and must be a string");
        }
    
        try {
            // Call the auth.pollinations.ai domains endpoint with JWT
            const response = await fetch(
                `${AUTH_API_BASE_URL}/api/user/${userId}/domains`,
                {
                    method: "PUT",
                    headers: {
                        "Content-Type": "application/json",
                        Authorization: `Bearer ${accessToken}`,
                    },
                    body: JSON.stringify({ domains }),
                },
            );
    
            if (!response.ok) {
                throw new Error(`Failed to update domains: ${response.statusText}`);
            }
    
            // Get the updated domains data
            const updatedData = await response.json();
    
            // Return the response in MCP format
            return createMCPResponse([createTextContent(updatedData, true)]);
        } catch (error) {
            console.error("Error updating domains:", error);
            throw error;
        }
    }
  • Registration of the 'updateDomains' tool in the authTools export array, including the tool name, description, Zod input schema for validation, and reference to the handler function.
    [
        "updateDomains",
        "Update domains allowlisted for a user using JWT authentication",
        {
            userId: z.string().describe("The GitHub user ID"),
            domains: z.array(z.string()).describe("The domains to allowlist"),
            accessToken: z
                .string()
                .describe("The JWT access token from exchangeToken"),
        },
        updateDomains,
    ],
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It implies a mutation operation ('Update') but doesn't specify whether this overwrites or merges with existing domains, what permissions are required, or potential side effects like rate limits. 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 a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is appropriately sized and front-loaded, making it easy to understand at a glance, with no wasted content.

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 complexity of a mutation tool with no annotations and no output schema, the description is incomplete. It fails to address key aspects like what the tool returns, error conditions, or behavioral nuances, leaving the agent with insufficient context for reliable invocation.

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?

The input schema has 100% description coverage, clearly documenting all three parameters (userId, domains, sessionId). The description adds no additional meaning beyond what the schema provides, such as format details or usage examples, so it meets the baseline for high schema coverage without compensating further.

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 ('Update') and the resource ('domains allowlisted for a user'), making the purpose understandable. However, it doesn't explicitly distinguish this tool from its sibling 'getDomains', which appears to be a read counterpart, leaving room for improvement in sibling differentiation.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'getDomains' or other sibling tools. It lacks context about prerequisites, such as authentication or user permissions, and doesn't mention any exclusions or specific scenarios for its application.

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/tusharpatil2912/pollinations-mcp'

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