@snahrup/notion-hero-image-mcp
Version:
AI-powered animated hero banner generator for Notion pages. Integrates DALL-E 3, Google Veo 3, Cloudinary CDN, and Notion API.
51 lines • 1.56 kB
JavaScript
import { Client } from '@notionhq/client';
const notion = new Client({
auth: process.env.NOTION_API_TOKEN,
});
const definition = {
name: 'set_notion_cover',
description: 'Set a Notion page cover image from URL',
inputSchema: {
type: 'object',
properties: {
page_id: {
type: 'string',
description: 'Notion page ID (32 chars with hyphens)'
},
cover_url: {
type: 'string',
description: 'HTTPS URL of the cover image'
}
},
required: ['page_id', 'cover_url']
}
};
const handler = {
'tools/call': async (request) => {
if (request.params.name !== 'set_notion_cover')
return null;
const { page_id, cover_url } = request.params.arguments;
const response = await notion.pages.update({
page_id: page_id,
cover: {
type: 'external',
external: {
url: cover_url
}
}
});
return {
content: [{
type: 'text',
text: JSON.stringify({
success: true,
page_id: response.id,
cover_url: cover_url,
last_edited: response.last_edited_time || new Date().toISOString()
})
}]
};
}
};
export default { definition, handler };
//# sourceMappingURL=set-notion-cover.js.map