Skip to main content
Glama
HenkDz

Self-Hosted Supabase MCP Server

get_anon_key

Retrieve the configured anonymous access key for secure, read-only database operations in self-hosted Supabase environments.

Instructions

Returns the configured Supabase anon key for this server.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The async execute function implementing the get_anon_key tool logic: extracts the client from context, calls client.getAnonKey(), and returns the key wrapped in an object.
    execute: async (input: GetAnonKeyInput, context: ToolContext) => {
        const client = context.selfhostedClient;
        const key = client.getAnonKey(); // Use getter from client
        return { anon_key: key };
    },
  • Zod input schema (empty object, no parameters) and output schema defining anon_key as string.
    // Input schema (none needed)
    const GetAnonKeyInputSchema = z.object({});
    type GetAnonKeyInput = z.infer<typeof GetAnonKeyInputSchema>;
    
    // Output schema
    const GetAnonKeyOutputSchema = z.object({
        anon_key: z.string(),
    });
  • src/index.ts:108-108 (registration)
    Registers the getAnonKeyTool in the availableTools object by name, cast to AppTool interface.
    [getAnonKeyTool.name]: getAnonKeyTool as AppTool,
  • Public getter method on SelfhostedSupabaseClient that returns the configured supabaseAnonKey.
    public getAnonKey(): string {
        return this.options.supabaseAnonKey;
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states this is a read operation ('Returns'), but doesn't disclose behavioral traits like authentication requirements, rate limits, whether the key is sensitive data, or what format the key is returned in. The description is minimal and lacks important operational context.

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 with zero wasted words. It's front-loaded with the core purpose and appropriately sized for a simple, parameterless tool.

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 tool's simplicity (0 parameters, no output schema) and lack of annotations, the description is complete enough for basic understanding but inadequate for operational use. It doesn't address security implications (anon keys are typically public but should be handled carefully), return format, or error conditions that would help an agent use it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters with 100% schema coverage, so no parameter documentation is needed. The description appropriately doesn't discuss parameters, earning a baseline score of 4 for this dimension.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Returns') and resource ('configured Supabase anon key for this server'), distinguishing it from sibling tools like get_service_key or get_project_url by specifying the exact type of key being retrieved.

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

Usage Guidelines3/5

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

The description implies usage context (when you need the anon key for this server), but doesn't explicitly state when to use this tool versus alternatives like get_service_key or when not to use it. No prerequisites or exclusions are mentioned.

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/HenkDz/selfhosted-supabase-mcp'

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