updatePageProperties.ts•705 B
import { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
import { notion } from "../services/notion.js";
import { handleNotionError } from "../utils/error.js";
import { UpdatePagePropertiesParams } from "../types/page.js";
export async function updatePageProperties(
params: UpdatePagePropertiesParams
): Promise<CallToolResult> {
try {
const response = await notion.pages.update({
page_id: params.pageId,
properties: params.properties,
});
return {
content: [
{
type: "text",
text: `Page properties updated successfully: ${response.id}`,
},
],
};
} catch (error) {
return handleNotionError(error);
}
}