list-notes
Retrieve notes for any CRM record type including companies, people, deals, or tasks by specifying the record ID and resource type.
Instructions
Get notes for any record type (companies, people, deals)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of results to return | |
| offset | No | Number of results to skip for pagination | |
| parent_record_id | No | Alias for record_id (backward compatibility) | |
| record_id | No | Record ID to list notes for | |
| resource_type | Yes | Type of resource to operate on (companies, people, lists, records, tasks) |
Implementation Reference
- Primary handler function executing the list-notes tool logic: fetches notes from Attio API /v2/notes using GET with query parameters for parent resource and record.export async function handleListNotes( client: HttpClient, params: { resource_type: 'companies' | 'people' | 'deals'; record_id: string; limit?: number; offset?: number; } ): Promise<ToolResult> { try { const { resource_type, record_id, limit = 10, offset = 0 } = params; // Notes API uses GET with query params, not POST const queryParams = new URLSearchParams({ parent_object: resource_type, parent_record_id: record_id, limit: String(limit), offset: String(offset), }); const response = await client.get<AttioApiResponse<AttioNote[]>>( `/v2/notes?${queryParams.toString()}` ); const notes = response.data.data; if (!notes || notes.length === 0) { return structuredResult( [], `No notes found for ${resource_type} ${record_id}` ); } const lines = notes.map((note) => { const noteId = note.id?.note_id || 'unknown'; const title = note.title || 'Untitled'; const preview = (note.content_plaintext || '').slice(0, 100); return `- ${title} (ID: ${noteId})\n ${preview}${preview.length >= 100 ? '...' : ''}`; }); return structuredResult( notes, `Notes for ${resource_type} ${record_id}:\n${lines.join('\n')}` ); } catch (error) { const { message, details } = extractErrorInfo(error); return errorResult(message || 'Failed to list notes', details); } }
- packages/core/src/tools/handlers.ts:1037-1039 (registration)Registration of list-notes in the central tool handler dispatcher map.'list-notes': async (client, params) => handleListNotes(client, params as Parameters<typeof handleListNotes>[1]), };
- Input schema, description, and annotations defining the list-notes tool interface.export const listNotesDefinition: ToolDefinition = { name: 'list-notes', description: formatDescription({ capability: 'Retrieve notes for a record with timestamps', boundaries: 'create or modify notes; read-only', constraints: 'Requires resource_type, record_id; sorted by creation date', recoveryHint: 'If empty, verify record has notes with records_get_details', }), inputSchema: { type: 'object', properties: { resource_type: { type: 'string', enum: ['companies', 'people', 'deals'], description: 'Type of resource to list notes for', }, record_id: { type: 'string', description: 'Record ID to list notes for', }, ...PAGINATION_SCHEMA, }, required: ['resource_type', 'record_id'], }, annotations: { readOnlyHint: true, }, };
- packages/core/src/tools/definitions.ts:426-426 (registration)Export and registration of listNotesDefinition in coreToolDefinitions map.'list-notes': listNotesDefinition,
- src/handlers/tool-configs/universal/core/index.ts:36-36 (registration)Universal tool configuration registration for list-notes in main application handlers.'list-notes': listNotesConfig,