mcp-grampsweb 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,88 @@
1
+ /**
2
+ * List and batch retrieval tools
3
+ */
4
+ import { z } from "zod";
5
+ declare const listSchema: z.ZodObject<{
6
+ entity_type: z.ZodEnum<["people", "families", "events", "places", "sources", "citations", "repositories", "media", "notes"]>;
7
+ page: z.ZodDefault<z.ZodNumber>;
8
+ pagesize: z.ZodDefault<z.ZodNumber>;
9
+ }, "strip", z.ZodTypeAny, {
10
+ page: number;
11
+ pagesize: number;
12
+ entity_type: "people" | "families" | "events" | "places" | "sources" | "citations" | "repositories" | "media" | "notes";
13
+ }, {
14
+ entity_type: "people" | "families" | "events" | "places" | "sources" | "citations" | "repositories" | "media" | "notes";
15
+ page?: number | undefined;
16
+ pagesize?: number | undefined;
17
+ }>;
18
+ declare const batchSchema: z.ZodObject<{
19
+ entity_type: z.ZodEnum<["people", "families", "events", "places", "sources", "citations", "repositories", "media", "notes"]>;
20
+ handles: z.ZodArray<z.ZodString, "many">;
21
+ }, "strip", z.ZodTypeAny, {
22
+ entity_type: "people" | "families" | "events" | "places" | "sources" | "citations" | "repositories" | "media" | "notes";
23
+ handles: string[];
24
+ }, {
25
+ entity_type: "people" | "families" | "events" | "places" | "sources" | "citations" | "repositories" | "media" | "notes";
26
+ handles: string[];
27
+ }>;
28
+ /**
29
+ * List all entities of a given type with pagination
30
+ */
31
+ export declare function grampsList(params: z.infer<typeof listSchema>): Promise<string>;
32
+ /**
33
+ * Get multiple entities by handles in a single call
34
+ */
35
+ export declare function grampsGetBatch(params: z.infer<typeof batchSchema>): Promise<string>;
36
+ export declare const listTools: {
37
+ gramps_list: {
38
+ name: string;
39
+ description: string;
40
+ inputSchema: {
41
+ type: "object";
42
+ properties: {
43
+ entity_type: {
44
+ type: string;
45
+ enum: string[];
46
+ description: string;
47
+ };
48
+ page: {
49
+ type: string;
50
+ description: string;
51
+ default: number;
52
+ };
53
+ pagesize: {
54
+ type: string;
55
+ description: string;
56
+ default: number;
57
+ };
58
+ };
59
+ required: string[];
60
+ };
61
+ handler: typeof grampsList;
62
+ };
63
+ gramps_get_batch: {
64
+ name: string;
65
+ description: string;
66
+ inputSchema: {
67
+ type: "object";
68
+ properties: {
69
+ entity_type: {
70
+ type: string;
71
+ enum: string[];
72
+ description: string;
73
+ };
74
+ handles: {
75
+ type: string;
76
+ items: {
77
+ type: string;
78
+ };
79
+ description: string;
80
+ };
81
+ };
82
+ required: string[];
83
+ };
84
+ handler: typeof grampsGetBatch;
85
+ };
86
+ };
87
+ export {};
88
+ //# sourceMappingURL=list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/tools/list.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,QAAA,MAAM,UAAU;;;;;;;;;;;;EAcd,CAAC;AAGH,QAAA,MAAM,WAAW;;;;;;;;;EAaf,CAAC;AA4DH;;GAEG;AACH,wBAAsB,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAyBpF;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAyDzF;AAGD,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyDrB,CAAC"}
@@ -0,0 +1,222 @@
1
+ /**
2
+ * List and batch retrieval tools
3
+ */
4
+ import { z } from "zod";
5
+ import { grampsClient } from "../client.js";
6
+ import { ENTITY_ENDPOINT_MAP } from "../constants.js";
7
+ import { formatEntityList, formatToolResponse } from "../utils/response.js";
8
+ import { formatPersonName } from "../utils/formatting.js";
9
+ // Schema for list operation
10
+ const listSchema = z.object({
11
+ entity_type: z.enum([
12
+ "people",
13
+ "families",
14
+ "events",
15
+ "places",
16
+ "sources",
17
+ "citations",
18
+ "repositories",
19
+ "media",
20
+ "notes",
21
+ ]).describe("Type of entity to list"),
22
+ page: z.number().int().positive().default(1).describe("Page number (1-indexed)"),
23
+ pagesize: z.number().int().positive().max(100).default(20).describe("Results per page (max 100)"),
24
+ });
25
+ // Schema for batch retrieval
26
+ const batchSchema = z.object({
27
+ entity_type: z.enum([
28
+ "people",
29
+ "families",
30
+ "events",
31
+ "places",
32
+ "sources",
33
+ "citations",
34
+ "repositories",
35
+ "media",
36
+ "notes",
37
+ ]).describe("Type of entities to retrieve"),
38
+ handles: z.array(z.string()).min(1).max(50).describe("List of entity handles (max 50)"),
39
+ });
40
+ /**
41
+ * Extract summary information from an entity based on its type
42
+ */
43
+ function extractEntitySummary(entity, entityType) {
44
+ const base = {
45
+ handle: entity.handle,
46
+ gramps_id: entity.gramps_id,
47
+ };
48
+ switch (entityType) {
49
+ case "people": {
50
+ const person = entity;
51
+ return {
52
+ ...base,
53
+ name: formatPersonName(person.primary_name),
54
+ gender: person.gender === 1 ? "male" : person.gender === 0 ? "female" : "unknown",
55
+ };
56
+ }
57
+ case "families": {
58
+ const family = entity;
59
+ return {
60
+ ...base,
61
+ father_handle: family.father_handle || null,
62
+ mother_handle: family.mother_handle || null,
63
+ children_count: family.child_ref_list?.length || 0,
64
+ type: family.type || "Unknown",
65
+ };
66
+ }
67
+ case "events": {
68
+ const event = entity;
69
+ return {
70
+ ...base,
71
+ type: event.type || "Unknown",
72
+ date: event.date?.text || (event.date?.dateval ? event.date.dateval.join("-") : null),
73
+ place_handle: event.place || null,
74
+ };
75
+ }
76
+ case "places": {
77
+ const place = entity;
78
+ return {
79
+ ...base,
80
+ name: place.name?.value || place.title || "Unknown",
81
+ type: place.place_type || null,
82
+ };
83
+ }
84
+ case "sources": {
85
+ const source = entity;
86
+ return {
87
+ ...base,
88
+ title: source.title || "Untitled",
89
+ author: source.author || null,
90
+ };
91
+ }
92
+ default:
93
+ return base;
94
+ }
95
+ }
96
+ /**
97
+ * List all entities of a given type with pagination
98
+ */
99
+ export async function grampsList(params) {
100
+ const { entity_type, page, pagesize } = listSchema.parse(params);
101
+ const endpoint = ENTITY_ENDPOINT_MAP[entity_type];
102
+ if (!endpoint) {
103
+ throw new Error(`Unknown entity type: ${entity_type}`);
104
+ }
105
+ const response = await grampsClient.get(endpoint, {
106
+ page,
107
+ pagesize,
108
+ });
109
+ if (!response || (Array.isArray(response) && response.length === 0)) {
110
+ return formatToolResponse({
111
+ status: "empty",
112
+ summary: `No ${entity_type} found in the database`,
113
+ details: `Use gramps_create_${entity_type.replace(/s$/, "")} to add new records.`,
114
+ });
115
+ }
116
+ const entities = Array.isArray(response) ? response : [response];
117
+ const formattedEntities = entities.map((entity) => extractEntitySummary(entity, entity_type));
118
+ return formatEntityList(entity_type, formattedEntities);
119
+ }
120
+ /**
121
+ * Get multiple entities by handles in a single call
122
+ */
123
+ export async function grampsGetBatch(params) {
124
+ const { entity_type, handles } = batchSchema.parse(params);
125
+ const endpoint = ENTITY_ENDPOINT_MAP[entity_type];
126
+ if (!endpoint) {
127
+ throw new Error(`Unknown entity type: ${entity_type}`);
128
+ }
129
+ // Fetch all entities in parallel
130
+ const fetchPromises = handles.map(async (handle) => {
131
+ try {
132
+ const entity = await grampsClient.get(`${endpoint}${handle}`);
133
+ return { handle, success: true, entity };
134
+ }
135
+ catch (error) {
136
+ return { handle, success: false, error: error instanceof Error ? error.message : String(error) };
137
+ }
138
+ });
139
+ const results = await Promise.all(fetchPromises);
140
+ const successful = results.filter((r) => r.success && r.entity);
141
+ const failed = results.filter((r) => !r.success);
142
+ if (successful.length === 0) {
143
+ return formatToolResponse({
144
+ status: "empty",
145
+ summary: `None of the ${handles.length} requested ${entity_type} were found`,
146
+ data: { failed: failed.map((f) => ({ handle: f.handle, error: f.error })) },
147
+ details: "Verify handles using gramps_find or gramps_list first.",
148
+ });
149
+ }
150
+ const data = {
151
+ count: successful.length,
152
+ results: successful.map((r) => r.entity),
153
+ };
154
+ if (failed.length > 0) {
155
+ data.failed = failed.map((f) => ({ handle: f.handle, error: f.error }));
156
+ }
157
+ return formatToolResponse({
158
+ status: "success",
159
+ summary: `Retrieved ${successful.length} of ${handles.length} ${entity_type}`,
160
+ data,
161
+ details: failed.length > 0
162
+ ? `${failed.length} handle(s) could not be found. See failed array for details.`
163
+ : undefined,
164
+ });
165
+ }
166
+ // Tool definitions for MCP
167
+ export const listTools = {
168
+ gramps_list: {
169
+ name: "gramps_list",
170
+ description: "List all entities of a given type with pagination. " +
171
+ "USE FOR: Getting all people, events, families, etc. when you need an overview. " +
172
+ "RETURNS: Array of entity summaries (handle, gramps_id, key identifier). " +
173
+ "NEXT STEP: Use gramps_get with handles for full details.",
174
+ inputSchema: {
175
+ type: "object",
176
+ properties: {
177
+ entity_type: {
178
+ type: "string",
179
+ enum: ["people", "families", "events", "places", "sources", "citations", "repositories", "media", "notes"],
180
+ description: "Type of entity to list",
181
+ },
182
+ page: {
183
+ type: "number",
184
+ description: "Page number (1-indexed, default 1)",
185
+ default: 1,
186
+ },
187
+ pagesize: {
188
+ type: "number",
189
+ description: "Results per page (max 100, default 20)",
190
+ default: 20,
191
+ },
192
+ },
193
+ required: ["entity_type"],
194
+ },
195
+ handler: grampsList,
196
+ },
197
+ gramps_get_batch: {
198
+ name: "gramps_get_batch",
199
+ description: "Retrieve multiple entities by their handles in a single call. " +
200
+ "USE FOR: Getting full details of several people/events at once, reducing API calls. " +
201
+ "REQUIRED: entity_type, handles array (max 50). " +
202
+ "RETURNS: Array of complete entity objects with any failures noted.",
203
+ inputSchema: {
204
+ type: "object",
205
+ properties: {
206
+ entity_type: {
207
+ type: "string",
208
+ enum: ["people", "families", "events", "places", "sources", "citations", "repositories", "media", "notes"],
209
+ description: "Type of entities to retrieve",
210
+ },
211
+ handles: {
212
+ type: "array",
213
+ items: { type: "string" },
214
+ description: "List of entity handles to retrieve (max 50)",
215
+ },
216
+ },
217
+ required: ["entity_type", "handles"],
218
+ },
219
+ handler: grampsGetBatch,
220
+ },
221
+ };
222
+ //# sourceMappingURL=list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.js","sourceRoot":"","sources":["../../src/tools/list.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAG1D,4BAA4B;AAC5B,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1B,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC;QAClB,QAAQ;QACR,UAAU;QACV,QAAQ;QACR,QAAQ;QACR,SAAS;QACT,WAAW;QACX,cAAc;QACd,OAAO;QACP,OAAO;KACR,CAAC,CAAC,QAAQ,CAAC,wBAAwB,CAAC;IACrC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,yBAAyB,CAAC;IAChF,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,4BAA4B,CAAC;CAClG,CAAC,CAAC;AAEH,6BAA6B;AAC7B,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC;QAClB,QAAQ;QACR,UAAU;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