Skip to main content
Glama

config

Manage server configuration and credential state for Notion integration. Perform actions like checking status, starting setup, resetting credentials, or clearing cache.

Instructions

Manage server configuration and credential state.

Actions:

  • status: current credential state, token source, setup URL

  • setup_start (-> force): trigger relay setup to configure Notion token via browser

  • setup_reset: clear credentials and config, return to awaiting_setup

  • setup_complete: re-check credentials after external config changes

  • set: update a runtime setting (notion has no mutable settings; returns info)

  • cache_clear: clear any cached state (no-op for notion)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesAction to perform
forceNoForce setup_start even if already configured
keyNoSetting key (for set action)
valueNoSetting value (for set action)

Implementation Reference

  • ConfigInput interface defining the schema for the config tool: action (status|setup_start|setup_reset|setup_complete|set|cache_clear), force, key, value.
    export interface ConfigInput {
      action: 'status' | 'setup_start' | 'setup_reset' | 'setup_complete' | 'set' | 'cache_clear'
      force?: boolean
      key?: string
      value?: string
    }
  • Main handler function for the config tool. Manages credential state with actions: status, setup_start, setup_reset, setup_complete, set, cache_clear. Does not require a Notion client.
    export async function config(input: ConfigInput): Promise<any> {
      return withErrorHandling(async () => {
        switch (input.action) {
          case 'status': {
            const state = getState()
            const token = getSubjectToken()
            const publicUrl = process.env.PUBLIC_URL ?? null
            return {
              action: 'status',
              state,
              has_token: token !== null,
              setup_url: publicUrl ? `${publicUrl}/authorize` : null,
              token_source: token ? (process.env.NOTION_TOKEN ? 'environment' : publicUrl ? 'oauth' : 'relay') : null
            }
          }
    
          case 'setup_start': {
            // Post stdio-pure + http-multi-user split (2026-05-01): the
            // daemon-bridge relay setup spawn is gone. In stdio mode the
            // server requires NOTION_TOKEN env at startup. In HTTP mode the
            // OAuth flow lives at <PUBLIC_URL>/authorize served by the same
            // process -- no separate trigger needed.
            const publicUrl = process.env.PUBLIC_URL
            if (publicUrl) {
              return {
                action: 'setup_start',
                state: getState(),
                setup_url: `${publicUrl}/authorize`,
                message: `Open ${publicUrl}/authorize in your browser to complete the Notion OAuth flow.`
              }
            }
            return {
              action: 'setup_start',
              state: getState(),
              setup_url: null,
              message:
                'In stdio mode set NOTION_TOKEN env var in your MCP plugin config (get token from https://www.notion.so/my-integrations). To use HTTP/OAuth flow run with TRANSPORT_MODE=http and PUBLIC_URL set.'
            }
          }
    
          case 'setup_reset': {
            resetState()
            return {
              action: 'setup_reset',
              state: getState(),
              message: 'Credential state reset. Token cleared, config file deleted. Use setup_start to reconfigure.'
            }
          }
    
          case 'setup_complete': {
            const newState = await resolveCredentialState()
            return {
              action: 'setup_complete',
              state: newState,
              has_token: getSubjectToken() !== null,
              message:
                newState === 'configured'
                  ? 'Credentials verified. Notion tools are ready.'
                  : 'No credentials found. Use setup_start to begin relay setup.'
            }
          }
    
          case 'set': {
            return {
              action: 'set',
              ok: false,
              error: 'Notion has no mutable runtime settings. To update your token, use setup_reset then setup_start.'
            }
          }
    
          case 'cache_clear': {
            return {
              action: 'cache_clear',
              ok: true,
              cleared: 0,
              message: 'No client-side cache to clear. Notion API responses are not cached.'
            }
          }
    
          default:
            throw new NotionMCPError(
              `Unsupported action: ${(input as any).action}`,
              'VALIDATION_ERROR',
              'Valid actions: status, setup_start, setup_reset, setup_complete, set, cache_clear'
            )
        }
      })()
    }
  • MCP tool registration schema for 'config' - defines name, description, annotations, and inputSchema with action, force, key, value properties.
    {
      name: 'config',
      description:
        'Manage server configuration and credential state.\n\nActions:\n- status: current credential state, token source, setup URL\n- setup_start (-> force): trigger relay setup to configure Notion token via browser\n- setup_reset: clear credentials and config, return to awaiting_setup\n- setup_complete: re-check credentials after external config changes\n- set: update a runtime setting (notion has no mutable settings; returns info)\n- cache_clear: clear any cached state (no-op for notion)',
      annotations: {
        title: 'Config',
        readOnlyHint: false,
        destructiveHint: false,
        idempotentHint: false,
        openWorldHint: false
      },
      inputSchema: {
        type: 'object',
        properties: {
          action: {
            type: 'string',
            enum: ['status', 'setup_start', 'setup_reset', 'setup_complete', 'set', 'cache_clear'],
            description: 'Action to perform'
          },
          force: {
            type: 'boolean',
            description: 'Force setup_start even if already configured'
          },
          key: {
            type: 'string',
            description: 'Setting key (for set action)'
          },
          value: {
            type: 'string',
            description: 'Setting value (for set action)'
          }
        },
        required: ['action']
      }
    },
  • Routing case in CallToolRequestSchema handler that dispatches 'config' to the config() handler function.
    case 'config':
      result = await config(args as any)
      break
  • Import of the config function from the composite/config.ts module into the tool registry.
    import { config } from './composite/config.js'
Behavior1/5

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

The annotation 'destructiveHint=false' contradicts the described action 'setup_reset: clear credentials and config', which is clearly destructive. This is a serious inconsistency. The description does provide action details, but the contradiction undermines transparency.

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 concise and well-structured, using a clear heading and bullet points for each action. Every sentence adds value, with no wasted words. The general purpose is front-loaded, making it easy to scan.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

While the input schema and action list are covered, the description omits output behavior and error conditions. Since there is no output schema, the agent lacks information on what each action returns (e.g., status output format). This gap reduces completeness for a config management tool.

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 description adds meaning beyond the input schema by linking the 'force' parameter to 'setup_start', and 'key'/'value' to the 'set' action. Since schema coverage is 100% (each parameter has a basic description), the additional relational context improves semantic understanding.

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 'Manage server configuration and credential state' and lists specific actions (status, setup, reset, etc.), distinguishing it from sibling tools that handle other resources (blocks, pages, etc.). The verb+resource combination is specific and unambiguous.

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 explains the actions but does not explicitly state when to use this tool versus the sibling 'config__open_relay' or other tools. While the purpose is clear, there is no guidance on exclusions or alternatives, leaving the agent to infer context from the tool name and sibling list.

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/n24q02m/better-notion-mcp'

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