Skip to main content
Glama
makenotion
by makenotion

API-patch-page

Update Notion page properties, including titles, icons, covers, and status (archived/in trash), using a structured input format. Ideal for programmatically modifying Notion pages via API integration.

Instructions

Notion | Update page properties

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
archivedNo
coverNoA cover image for the page. Only [external file objects](https://developers.notion.com/reference/file-object) are supported.
iconNoA page icon for the page. Supported types are [external file object](https://developers.notion.com/reference/file-object) or [emoji object](https://developers.notion.com/reference/emoji-object).
in_trashNoSet to true to delete a block. Set to false to restore a block.
page_idYesThe identifier for the Notion page to be updated.
propertiesNoThe property values to update for the page. The keys are the names or IDs of the property and the values are property values. If a page property ID is not included, then it is not changed.

Implementation Reference

  • The MCP tool execution handler for all dynamically generated tools, including "API-patch-page". It resolves the tool name to the corresponding OpenAPI operation (PATCH /pages/{page_id} for patch-page), executes the HTTP request via HttpClient, and formats the response as MCP content.
    // Handle tool calling
    this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
      const { name, arguments: params } = request.params
    
      // Find the operation in OpenAPI spec
      const operation = this.findOperation(name)
      if (!operation) {
        throw new Error(`Method ${name} not found`)
      }
    
      try {
        // Execute the operation
        const response = await this.httpClient.executeOperation(operation, params)
    
        // Convert response to MCP format
        return {
          content: [
            {
              type: 'text', // currently this is the only type that seems to be used by mcp server
              text: JSON.stringify(response.data), // TODO: pass through the http status code text?
            },
          ],
        }
      } catch (error) {
        console.error('Error in tool call', error)
        if (error instanceof HttpClientError) {
          console.error('HttpClientError encountered, returning structured error', error)
          const data = error.data?.response?.data ?? error.data ?? {}
          return {
            content: [
              {
                type: 'text',
                text: JSON.stringify({
                  status: 'error', // TODO: get this from http status code?
                  ...(typeof data === 'object' ? data : { data: data }),
                }),
              },
            ],
          }
        }
        throw error
      }
    })
  • Registers the listTools request handler which dynamically constructs and returns the list of available tools. Constructs tool names as 'API-{operationId}' (e.g. 'API-patch-page') from the OpenAPI spec converter output.
    // Handle tool listing
    this.server.setRequestHandler(ListToolsRequestSchema, async () => {
      const tools: Tool[] = []
    
      // Add methods as separate tools to match the MCP format
      Object.entries(this.tools).forEach(([toolName, def]) => {
        def.methods.forEach(method => {
          const toolNameWithMethod = `${toolName}-${method.name}`;
          const truncatedToolName = this.truncateToolName(toolNameWithMethod);
          tools.push({
            name: truncatedToolName,
            description: method.description,
            inputSchema: method.inputSchema as Tool['inputSchema'],
          })
        })
      })
    
      return { tools }
    })
  • Generates the input schemas and tool metadata for all MCP tools from the OpenAPI document. The tool 'API-patch-page' is created here when processing the operation with operationId 'patch-page', deriving inputSchema from parameters and requestBody.
    convertToMCPTools(): {
      tools: Record<string, { methods: NewToolMethod[] }>
      openApiLookup: Record<string, OpenAPIV3.OperationObject & { method: string; path: string }>
      zip: Record<string, { openApi: OpenAPIV3.OperationObject & { method: string; path: string }; mcp: NewToolMethod }>
    } {
      const apiName = 'API'
    
      const openApiLookup: Record<string, OpenAPIV3.OperationObject & { method: string; path: string }> = {}
      const tools: Record<string, { methods: NewToolMethod[] }> = {
        [apiName]: { methods: [] },
      }
      const zip: Record<string, { openApi: OpenAPIV3.OperationObject & { method: string; path: string }; mcp: NewToolMethod }> = {}
      for (const [path, pathItem] of Object.entries(this.openApiSpec.paths || {})) {
        if (!pathItem) continue
    
        for (const [method, operation] of Object.entries(pathItem)) {
          if (!this.isOperation(method, operation)) continue
    
          const mcpMethod = this.convertOperationToMCPMethod(operation, method, path)
          if (mcpMethod) {
            const uniqueName = this.ensureUniqueName(mcpMethod.name)
            mcpMethod.name = uniqueName
            mcpMethod.description = this.getDescription(operation.summary || operation.description || '')
            tools[apiName]!.methods.push(mcpMethod)
            openApiLookup[apiName + '-' + uniqueName] = { ...operation, method, path }
            zip[apiName + '-' + uniqueName] = { openApi: { ...operation, method, path }, mcp: mcpMethod }
          }
        }
      }
    
      return { tools, openApiLookup, zip }
    }
  • Helper method that maps tool name (e.g. 'API-patch-page') to the corresponding OpenAPI operation object for execution.
    private findOperation(operationId: string): (OpenAPIV3.OperationObject & { method: string; path: string }) | null {
      return this.openApiLookup[operationId] ?? null
    }
Behavior2/5

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

With no annotations provided, the description carries full burden but provides minimal behavioral information. It mentions 'Update' which implies mutation, but doesn't disclose permission requirements, whether changes are reversible, rate limits, or what happens when properties are omitted. The schema reveals additional behaviors like archiving and trash management that aren't mentioned.

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 extremely concise with just two words plus context. Every word earns its place - 'Notion' provides context, 'Update' specifies the action, and 'page properties' identifies the resource. No wasted words or redundancy.

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?

For a mutation tool with 6 parameters, no annotations, and no output schema, this description is inadequate. It doesn't explain what successful updates return, error conditions, or the scope of changes possible. The schema reveals complex nested structures for properties, cover, and icon that aren't hinted at in the description.

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?

With 83% schema description coverage, the schema does most of the parameter documentation work. The description adds no specific parameter information beyond the generic 'page properties' mention. It doesn't explain what 'properties' means in the Notion context or clarify the relationship between different parameter groups.

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 resource ('page properties') with the Notion context. It distinguishes this as a modification tool rather than creation or retrieval, though it doesn't explicitly differentiate from similar update tools like 'API-update-a-block' or 'API-update-a-database'.

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?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites like needing a page ID, when to use this versus 'API-patch-block-children' for content updates, or what constitutes appropriate 'page properties' to modify.

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

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/makenotion/notion-mcp-server'

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