Skip to main content
Glama
list-comments.ts1.3 kB
import type {McpServer} from '@modelcontextprotocol/sdk/server/mcp.js'; import {z} from 'zod'; import type {ToolContext} from './types.js'; import {recordId} from './schemas.js'; import {jsonResult} from '../utils/response.js'; const outputSchema = z.object({ comments: z.array(z.object({ id: z.string(), createdTime: z.string(), lastUpdatedTime: z.string().nullable(), text: z.string(), author: z.object({ id: z.string(), email: z.string(), name: z.string().optional(), }), parentCommentId: z.string().optional(), })), offset: z.string().nullable(), }); export function registerListComments(server: McpServer, ctx: ToolContext): void { server.registerTool( 'list_comments', { title: 'List Comments', description: 'List comments on a record', inputSchema: { ...recordId, pageSize: z.number().optional().describe('Number of comments to return (max 100, default 100)'), offset: z.string().optional().describe('Offset for pagination'), }, outputSchema, annotations: { readOnlyHint: true, }, }, async (args) => { const response = await ctx.airtableService.listComments( args.baseId, args.tableId, args.recordId, args.pageSize, args.offset, ); return jsonResult(outputSchema.parse(response)); }, ); }

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/domdomegg/airtable-mcp-server'

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