mcp-grampsweb 1.2.0 → 1.3.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.
- package/dist/constants.d.ts +1 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +4 -0
- package/dist/constants.js.map +1 -1
- package/dist/schemas/common.d.ts +3 -3
- package/dist/schemas/common.js +1 -1
- package/dist/schemas/common.js.map +1 -1
- package/dist/schemas/entities.d.ts +10 -10
- package/dist/tools/convenience.d.ts +119 -0
- package/dist/tools/convenience.d.ts.map +1 -1
- package/dist/tools/convenience.js +234 -0
- package/dist/tools/convenience.js.map +1 -1
- package/dist/tools/create.d.ts +5 -1
- package/dist/tools/create.d.ts.map +1 -1
- package/dist/tools/create.js +9 -2
- package/dist/tools/create.js.map +1 -1
- package/dist/tools/delete.d.ts +79 -0
- package/dist/tools/delete.d.ts.map +1 -0
- package/dist/tools/delete.js +159 -0
- package/dist/tools/delete.js.map +1 -0
- package/dist/tools/index.d.ts +213 -3
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +5 -1
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/tags.d.ts +131 -0
- package/dist/tools/tags.d.ts.map +1 -0
- package/dist/tools/tags.js +296 -0
- package/dist/tools/tags.js.map +1 -0
- package/dist/tools/update.d.ts +11 -11
- package/dist/tools/update.d.ts.map +1 -1
- package/dist/tools/update.js +17 -6
- package/dist/tools/update.js.map +1 -1
- package/dist/types.d.ts +6 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/formatting.d.ts.map +1 -1
- package/dist/utils/formatting.js +5 -2
- package/dist/utils/formatting.js.map +1 -1
- package/dist/utils/response.d.ts +1 -1
- package/dist/utils/response.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/tools/index.js
CHANGED
|
@@ -7,6 +7,8 @@ import { analysisTools } from "./analysis.js";
|
|
|
7
7
|
import { listTools } from "./list.js";
|
|
8
8
|
import { updateTools } from "./update.js";
|
|
9
9
|
import { convenienceTools } from "./convenience.js";
|
|
10
|
+
import { deleteTools } from "./delete.js";
|
|
11
|
+
import { tagTools } from "./tags.js";
|
|
10
12
|
// Combine all tools
|
|
11
13
|
export const allTools = {
|
|
12
14
|
...searchTools,
|
|
@@ -15,9 +17,11 @@ export const allTools = {
|
|
|
15
17
|
...listTools,
|
|
16
18
|
...updateTools,
|
|
17
19
|
...convenienceTools,
|
|
20
|
+
...deleteTools,
|
|
21
|
+
...tagTools,
|
|
18
22
|
};
|
|
19
23
|
// Export tool names for registration
|
|
20
24
|
export const toolNames = Object.keys(allTools);
|
|
21
25
|
// Export individual tool groups
|
|
22
|
-
export { searchTools, createTools, analysisTools, listTools, updateTools, convenienceTools };
|
|
26
|
+
export { searchTools, createTools, analysisTools, listTools, updateTools, convenienceTools, deleteTools, tagTools };
|
|
23
27
|
//# sourceMappingURL=index.js.map
|
package/dist/tools/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,oBAAoB;AACpB,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,GAAG,WAAW;IACd,GAAG,WAAW;IACd,GAAG,aAAa;IAChB,GAAG,SAAS;IACZ,GAAG,WAAW;IACd,GAAG,gBAAgB;IACnB,GAAG,WAAW;IACd,GAAG,QAAQ;CACZ,CAAC;AAEF,qCAAqC;AACrC,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAE/C,gCAAgC;AAChC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,aAAa,EAAE,SAAS,EAAE,WAAW,EAAE,gBAAgB,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tag management tools
|
|
3
|
+
*/
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
declare const createTagSchema: z.ZodObject<{
|
|
6
|
+
name: z.ZodString;
|
|
7
|
+
color: z.ZodOptional<z.ZodString>;
|
|
8
|
+
priority: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
name: string;
|
|
11
|
+
color?: string | undefined;
|
|
12
|
+
priority?: number | undefined;
|
|
13
|
+
}, {
|
|
14
|
+
name: string;
|
|
15
|
+
color?: string | undefined;
|
|
16
|
+
priority?: number | undefined;
|
|
17
|
+
}>;
|
|
18
|
+
declare const tagEntitySchema: z.ZodObject<{
|
|
19
|
+
entity_type: z.ZodString;
|
|
20
|
+
handle: z.ZodString;
|
|
21
|
+
tag_handle: z.ZodString;
|
|
22
|
+
}, "strip", z.ZodTypeAny, {
|
|
23
|
+
entity_type: string;
|
|
24
|
+
handle: string;
|
|
25
|
+
tag_handle: string;
|
|
26
|
+
}, {
|
|
27
|
+
entity_type: string;
|
|
28
|
+
handle: string;
|
|
29
|
+
tag_handle: string;
|
|
30
|
+
}>;
|
|
31
|
+
/**
|
|
32
|
+
* List all tags in the database
|
|
33
|
+
*/
|
|
34
|
+
export declare function grampsListTags(): Promise<string>;
|
|
35
|
+
/**
|
|
36
|
+
* Create a new tag
|
|
37
|
+
*/
|
|
38
|
+
export declare function grampsCreateTag(params: z.infer<typeof createTagSchema>): Promise<string>;
|
|
39
|
+
/**
|
|
40
|
+
* Add a tag to an entity
|
|
41
|
+
*/
|
|
42
|
+
export declare function grampsTagEntity(params: z.infer<typeof tagEntitySchema>): Promise<string>;
|
|
43
|
+
/**
|
|
44
|
+
* Remove a tag from an entity
|
|
45
|
+
*/
|
|
46
|
+
export declare function grampsUntagEntity(params: z.infer<typeof tagEntitySchema>): Promise<string>;
|
|
47
|
+
export declare const tagTools: {
|
|
48
|
+
gramps_list_tags: {
|
|
49
|
+
name: string;
|
|
50
|
+
description: string;
|
|
51
|
+
inputSchema: {
|
|
52
|
+
type: "object";
|
|
53
|
+
properties: {};
|
|
54
|
+
required: never[];
|
|
55
|
+
};
|
|
56
|
+
handler: typeof grampsListTags;
|
|
57
|
+
};
|
|
58
|
+
gramps_create_tag: {
|
|
59
|
+
name: string;
|
|
60
|
+
description: string;
|
|
61
|
+
inputSchema: {
|
|
62
|
+
type: "object";
|
|
63
|
+
properties: {
|
|
64
|
+
name: {
|
|
65
|
+
type: string;
|
|
66
|
+
description: string;
|
|
67
|
+
};
|
|
68
|
+
color: {
|
|
69
|
+
type: string;
|
|
70
|
+
description: string;
|
|
71
|
+
};
|
|
72
|
+
priority: {
|
|
73
|
+
type: string;
|
|
74
|
+
description: string;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
required: string[];
|
|
78
|
+
};
|
|
79
|
+
handler: typeof grampsCreateTag;
|
|
80
|
+
};
|
|
81
|
+
gramps_tag_entity: {
|
|
82
|
+
name: string;
|
|
83
|
+
description: string;
|
|
84
|
+
inputSchema: {
|
|
85
|
+
type: "object";
|
|
86
|
+
properties: {
|
|
87
|
+
entity_type: {
|
|
88
|
+
type: string;
|
|
89
|
+
enum: string[];
|
|
90
|
+
description: string;
|
|
91
|
+
};
|
|
92
|
+
handle: {
|
|
93
|
+
type: string;
|
|
94
|
+
description: string;
|
|
95
|
+
};
|
|
96
|
+
tag_handle: {
|
|
97
|
+
type: string;
|
|
98
|
+
description: string;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
required: string[];
|
|
102
|
+
};
|
|
103
|
+
handler: typeof grampsTagEntity;
|
|
104
|
+
};
|
|
105
|
+
gramps_untag_entity: {
|
|
106
|
+
name: string;
|
|
107
|
+
description: string;
|
|
108
|
+
inputSchema: {
|
|
109
|
+
type: "object";
|
|
110
|
+
properties: {
|
|
111
|
+
entity_type: {
|
|
112
|
+
type: string;
|
|
113
|
+
enum: string[];
|
|
114
|
+
description: string;
|
|
115
|
+
};
|
|
116
|
+
handle: {
|
|
117
|
+
type: string;
|
|
118
|
+
description: string;
|
|
119
|
+
};
|
|
120
|
+
tag_handle: {
|
|
121
|
+
type: string;
|
|
122
|
+
description: string;
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
required: string[];
|
|
126
|
+
};
|
|
127
|
+
handler: typeof grampsUntagEntity;
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
export {};
|
|
131
|
+
//# sourceMappingURL=tags.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tags.d.ts","sourceRoot":"","sources":["../../src/tools/tags.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,QAAA,MAAM,eAAe;;;;;;;;;;;;EAOnB,CAAC;AAGH,QAAA,MAAM,eAAe;;;;;;;;;;;;EAMnB,CAAC;AAEH;;GAEG;AACH,wBAAsB,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC,CAgCtD;AAED;;GAEG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,GACtC,OAAO,CAAC,MAAM,CAAC,CAkCjB;AAED;;GAEG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,GACtC,OAAO,CAAC,MAAM,CAAC,CA0DjB;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,GACtC,OAAO,CAAC,MAAM,CAAC,CA0DjB;AAGD,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuHpB,CAAC"}
|
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tag management tools
|
|
3
|
+
*/
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
import { grampsClient } from "../client.js";
|
|
6
|
+
import { API_ENDPOINTS, ENTITY_ENDPOINT_MAP } from "../constants.js";
|
|
7
|
+
import { formatToolResponse } from "../utils/response.js";
|
|
8
|
+
// Schema for creating a tag
|
|
9
|
+
const createTagSchema = z.object({
|
|
10
|
+
name: z.string().describe("Tag name"),
|
|
11
|
+
color: z
|
|
12
|
+
.string()
|
|
13
|
+
.optional()
|
|
14
|
+
.describe("Hex color for the tag (e.g., '#FF5500')"),
|
|
15
|
+
priority: z.number().optional().describe("Priority (lower = higher priority)"),
|
|
16
|
+
});
|
|
17
|
+
// Schema for tagging/untagging an entity
|
|
18
|
+
const tagEntitySchema = z.object({
|
|
19
|
+
entity_type: z
|
|
20
|
+
.string()
|
|
21
|
+
.describe("Entity type: people, families, events, places, sources, citations, repositories, media, notes"),
|
|
22
|
+
handle: z.string().describe("Handle of the entity to tag/untag"),
|
|
23
|
+
tag_handle: z.string().describe("Handle of the tag to add/remove"),
|
|
24
|
+
});
|
|
25
|
+
/**
|
|
26
|
+
* List all tags in the database
|
|
27
|
+
*/
|
|
28
|
+
export async function grampsListTags() {
|
|
29
|
+
const tags = await grampsClient.get(API_ENDPOINTS.TAGS);
|
|
30
|
+
if (!tags || tags.length === 0) {
|
|
31
|
+
return formatToolResponse({
|
|
32
|
+
status: "success",
|
|
33
|
+
summary: "No tags found",
|
|
34
|
+
data: {
|
|
35
|
+
count: 0,
|
|
36
|
+
tags: [],
|
|
37
|
+
},
|
|
38
|
+
details: "Create tags using gramps_create_tag to organize your records.",
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
const tagList = tags.map((tag) => ({
|
|
42
|
+
handle: tag.handle,
|
|
43
|
+
gramps_id: tag.gramps_id,
|
|
44
|
+
name: tag.name,
|
|
45
|
+
color: tag.color || null,
|
|
46
|
+
priority: tag.priority ?? null,
|
|
47
|
+
}));
|
|
48
|
+
return formatToolResponse({
|
|
49
|
+
status: "success",
|
|
50
|
+
summary: `Found ${tags.length} tag(s)`,
|
|
51
|
+
data: {
|
|
52
|
+
count: tags.length,
|
|
53
|
+
tags: tagList,
|
|
54
|
+
},
|
|
55
|
+
details: "Use tag handles to tag entities with gramps_tag_entity.",
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Create a new tag
|
|
60
|
+
*/
|
|
61
|
+
export async function grampsCreateTag(params) {
|
|
62
|
+
const validated = createTagSchema.parse(params);
|
|
63
|
+
const tag = {
|
|
64
|
+
_class: "Tag",
|
|
65
|
+
name: validated.name,
|
|
66
|
+
color: validated.color,
|
|
67
|
+
priority: validated.priority,
|
|
68
|
+
};
|
|
69
|
+
const rawResponse = await grampsClient.post(API_ENDPOINTS.TAGS, tag);
|
|
70
|
+
const response = Array.isArray(rawResponse) ? rawResponse[0] : rawResponse;
|
|
71
|
+
if (!response?.handle) {
|
|
72
|
+
throw new Error(`API did not return entity handle after creating tag. Response: ${JSON.stringify(rawResponse)}`);
|
|
73
|
+
}
|
|
74
|
+
return formatToolResponse({
|
|
75
|
+
status: "success",
|
|
76
|
+
summary: `Created tag "${validated.name}"`,
|
|
77
|
+
data: {
|
|
78
|
+
handle: response.handle,
|
|
79
|
+
gramps_id: response.gramps_id,
|
|
80
|
+
name: validated.name,
|
|
81
|
+
color: validated.color || null,
|
|
82
|
+
},
|
|
83
|
+
details: `Use handle "${response.handle}" to tag entities with gramps_tag_entity.`,
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Add a tag to an entity
|
|
88
|
+
*/
|
|
89
|
+
export async function grampsTagEntity(params) {
|
|
90
|
+
const { entity_type, handle, tag_handle } = tagEntitySchema.parse(params);
|
|
91
|
+
// Validate entity type
|
|
92
|
+
const endpoint = ENTITY_ENDPOINT_MAP[entity_type.toLowerCase()];
|
|
93
|
+
if (!endpoint) {
|
|
94
|
+
throw new Error(`Invalid entity type "${entity_type}". Valid types: people, families, events, places, sources, citations, repositories, media, notes`);
|
|
95
|
+
}
|
|
96
|
+
// Fetch the existing entity
|
|
97
|
+
const entity = await grampsClient.get(`${endpoint}${handle}`);
|
|
98
|
+
// Check if tag is already applied
|
|
99
|
+
const existingTags = entity.tag_list || [];
|
|
100
|
+
if (existingTags.includes(tag_handle)) {
|
|
101
|
+
return formatToolResponse({
|
|
102
|
+
status: "success",
|
|
103
|
+
summary: `Tag already applied to ${entity_type.replace(/s$/, "")}`,
|
|
104
|
+
data: {
|
|
105
|
+
entity_type,
|
|
106
|
+
entity_handle: handle,
|
|
107
|
+
tag_handle,
|
|
108
|
+
tag_count: existingTags.length,
|
|
109
|
+
},
|
|
110
|
+
details: "No changes were made - tag was already applied.",
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
// Build updated entity with new tag
|
|
114
|
+
const updatedEntity = {
|
|
115
|
+
...entity,
|
|
116
|
+
tag_list: [...existingTags, tag_handle],
|
|
117
|
+
};
|
|
118
|
+
// PUT the updated entity
|
|
119
|
+
const rawResponse = await grampsClient.put(`${endpoint}${handle}`, updatedEntity);
|
|
120
|
+
const response = Array.isArray(rawResponse) ? rawResponse[0] : rawResponse;
|
|
121
|
+
return formatToolResponse({
|
|
122
|
+
status: "success",
|
|
123
|
+
summary: `Tagged ${entity_type.replace(/s$/, "")} ${entity.gramps_id}`,
|
|
124
|
+
data: {
|
|
125
|
+
entity_type,
|
|
126
|
+
entity_handle: handle,
|
|
127
|
+
entity_gramps_id: entity.gramps_id,
|
|
128
|
+
tag_handle,
|
|
129
|
+
tag_count: existingTags.length + 1,
|
|
130
|
+
},
|
|
131
|
+
details: `Tag added successfully. Entity now has ${existingTags.length + 1} tag(s).`,
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Remove a tag from an entity
|
|
136
|
+
*/
|
|
137
|
+
export async function grampsUntagEntity(params) {
|
|
138
|
+
const { entity_type, handle, tag_handle } = tagEntitySchema.parse(params);
|
|
139
|
+
// Validate entity type
|
|
140
|
+
const endpoint = ENTITY_ENDPOINT_MAP[entity_type.toLowerCase()];
|
|
141
|
+
if (!endpoint) {
|
|
142
|
+
throw new Error(`Invalid entity type "${entity_type}". Valid types: people, families, events, places, sources, citations, repositories, media, notes`);
|
|
143
|
+
}
|
|
144
|
+
// Fetch the existing entity
|
|
145
|
+
const entity = await grampsClient.get(`${endpoint}${handle}`);
|
|
146
|
+
// Check if tag exists
|
|
147
|
+
const existingTags = entity.tag_list || [];
|
|
148
|
+
if (!existingTags.includes(tag_handle)) {
|
|
149
|
+
return formatToolResponse({
|
|
150
|
+
status: "success",
|
|
151
|
+
summary: `Tag not found on ${entity_type.replace(/s$/, "")}`,
|
|
152
|
+
data: {
|
|
153
|
+
entity_type,
|
|
154
|
+
entity_handle: handle,
|
|
155
|
+
tag_handle,
|
|
156
|
+
tag_count: existingTags.length,
|
|
157
|
+
},
|
|
158
|
+
details: "No changes were made - tag was not applied to this entity.",
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
// Build updated entity without the tag
|
|
162
|
+
const updatedEntity = {
|
|
163
|
+
...entity,
|
|
164
|
+
tag_list: existingTags.filter((t) => t !== tag_handle),
|
|
165
|
+
};
|
|
166
|
+
// PUT the updated entity
|
|
167
|
+
const rawResponse = await grampsClient.put(`${endpoint}${handle}`, updatedEntity);
|
|
168
|
+
const response = Array.isArray(rawResponse) ? rawResponse[0] : rawResponse;
|
|
169
|
+
return formatToolResponse({
|
|
170
|
+
status: "success",
|
|
171
|
+
summary: `Removed tag from ${entity_type.replace(/s$/, "")} ${entity.gramps_id}`,
|
|
172
|
+
data: {
|
|
173
|
+
entity_type,
|
|
174
|
+
entity_handle: handle,
|
|
175
|
+
entity_gramps_id: entity.gramps_id,
|
|
176
|
+
tag_handle,
|
|
177
|
+
tag_count: existingTags.length - 1,
|
|
178
|
+
},
|
|
179
|
+
details: `Tag removed successfully. Entity now has ${existingTags.length - 1} tag(s).`,
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
// Tool definitions for MCP
|
|
183
|
+
export const tagTools = {
|
|
184
|
+
gramps_list_tags: {
|
|
185
|
+
name: "gramps_list_tags",
|
|
186
|
+
description: "List all tags in the database. " +
|
|
187
|
+
"RETURNS: Tag names, handles, colors, and priorities. " +
|
|
188
|
+
"USE FOR: Finding tag handles before tagging entities.",
|
|
189
|
+
inputSchema: {
|
|
190
|
+
type: "object",
|
|
191
|
+
properties: {},
|
|
192
|
+
required: [],
|
|
193
|
+
},
|
|
194
|
+
handler: grampsListTags,
|
|
195
|
+
},
|
|
196
|
+
gramps_create_tag: {
|
|
197
|
+
name: "gramps_create_tag",
|
|
198
|
+
description: "Create a new tag for organizing records. " +
|
|
199
|
+
"REQUIRED: name. " +
|
|
200
|
+
"OPTIONAL: color (hex format), priority. " +
|
|
201
|
+
"RETURNS: Handle to use with gramps_tag_entity.",
|
|
202
|
+
inputSchema: {
|
|
203
|
+
type: "object",
|
|
204
|
+
properties: {
|
|
205
|
+
name: {
|
|
206
|
+
type: "string",
|
|
207
|
+
description: "Tag name (e.g., 'Needs Research', 'Verified')",
|
|
208
|
+
},
|
|
209
|
+
color: {
|
|
210
|
+
type: "string",
|
|
211
|
+
description: "Hex color for the tag (e.g., '#FF5500', '#00FF00')",
|
|
212
|
+
},
|
|
213
|
+
priority: {
|
|
214
|
+
type: "number",
|
|
215
|
+
description: "Priority (lower number = higher priority)",
|
|
216
|
+
},
|
|
217
|
+
},
|
|
218
|
+
required: ["name"],
|
|
219
|
+
},
|
|
220
|
+
handler: grampsCreateTag,
|
|
221
|
+
},
|
|
222
|
+
gramps_tag_entity: {
|
|
223
|
+
name: "gramps_tag_entity",
|
|
224
|
+
description: "Add a tag to any entity. " +
|
|
225
|
+
"REQUIRED: entity_type, handle, tag_handle. " +
|
|
226
|
+
"USE FOR: Categorizing, marking records for review, or organizing. " +
|
|
227
|
+
"NOTE: Safe to call if tag is already applied.",
|
|
228
|
+
inputSchema: {
|
|
229
|
+
type: "object",
|
|
230
|
+
properties: {
|
|
231
|
+
entity_type: {
|
|
232
|
+
type: "string",
|
|
233
|
+
enum: [
|
|
234
|
+
"people",
|
|
235
|
+
"families",
|
|
236
|
+
"events",
|
|
237
|
+
"places",
|
|
238
|
+
"sources",
|
|
239
|
+
"citations",
|
|
240
|
+
"repositories",
|
|
241
|
+
"media",
|
|
242
|
+
"notes",
|
|
243
|
+
],
|
|
244
|
+
description: "Type of entity to tag",
|
|
245
|
+
},
|
|
246
|
+
handle: {
|
|
247
|
+
type: "string",
|
|
248
|
+
description: "Handle of the entity to tag",
|
|
249
|
+
},
|
|
250
|
+
tag_handle: {
|
|
251
|
+
type: "string",
|
|
252
|
+
description: "Handle of the tag to apply (from gramps_list_tags or gramps_create_tag)",
|
|
253
|
+
},
|
|
254
|
+
},
|
|
255
|
+
required: ["entity_type", "handle", "tag_handle"],
|
|
256
|
+
},
|
|
257
|
+
handler: grampsTagEntity,
|
|
258
|
+
},
|
|
259
|
+
gramps_untag_entity: {
|
|
260
|
+
name: "gramps_untag_entity",
|
|
261
|
+
description: "Remove a tag from an entity. " +
|
|
262
|
+
"REQUIRED: entity_type, handle, tag_handle. " +
|
|
263
|
+
"NOTE: Safe to call if tag is not applied.",
|
|
264
|
+
inputSchema: {
|
|
265
|
+
type: "object",
|
|
266
|
+
properties: {
|
|
267
|
+
entity_type: {
|
|
268
|
+
type: "string",
|
|
269
|
+
enum: [
|
|
270
|
+
"people",
|
|
271
|
+
"families",
|
|
272
|
+
"events",
|
|
273
|
+
"places",
|
|
274
|
+
"sources",
|
|
275
|
+
"citations",
|
|
276
|
+
"repositories",
|
|
277
|
+
"media",
|
|
278
|
+
"notes",
|
|
279
|
+
],
|
|
280
|
+
description: "Type of entity to untag",
|
|
281
|
+
},
|
|
282
|
+
handle: {
|
|
283
|
+
type: "string",
|
|
284
|
+
description: "Handle of the entity to untag",
|
|
285
|
+
},
|
|
286
|
+
tag_handle: {
|
|
287
|
+
type: "string",
|
|
288
|
+
description: "Handle of the tag to remove",
|
|
289
|
+
},
|
|
290
|
+
},
|
|
291
|
+
required: ["entity_type", "handle", "tag_handle"],
|
|
292
|
+
},
|
|
293
|
+
handler: grampsUntagEntity,
|
|
294
|
+
},
|
|
295
|
+
};
|
|
296
|
+
//# sourceMappingURL=tags.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tags.js","sourceRoot":"","sources":["../../src/tools/tags.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sB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oBACd,WAAW,EAAE,yEAAyE;iBACvF;aACF;YACD,QAAQ,EAAE,CAAC,aAAa,EAAE,QAAQ,EAAE,YAAY,CAAC;SAClD;QACD,OAAO,EAAE,eAAe;KACzB;IAED,mBAAmB,EAAE;QACnB,IAAI,EAAE,qBAAqB;QAC3B,WAAW,EACT,+BAA+B;YAC/B,6CAA6C;YAC7C,2CAA2C;QAC7C,WAAW,EAAE;YACX,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,WAAW,EAAE;oBACX,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE;wBACJ,QAAQ;wBACR,UAAU;wBACV,QAAQ;wBACR,QAAQ;wBACR,SAAS;wBACT,WAAW;wBACX,cAAc;wBACd,OAAO;wBACP,OAAO;qBACR;oBACD,WAAW,EAAE,yBAAyB;iBACvC;gBACD,MAAM,EAAE;oBACN,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,+BAA+B;iBAC7C;gBACD,UAAU,EAAE;oBACV,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,6BAA6B;iBAC3C;aACF;YACD,QAAQ,EAAE,CAAC,aAAa,EAAE,QAAQ,EAAE,YAAY,CAAC;SAClD;QACD,OAAO,EAAE,iBAAiB;KAC3B;CACF,CAAC"}
|
package/dist/tools/update.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ declare const updatePersonSchema: z.ZodObject<{
|
|
|
8
8
|
primary_name: z.ZodOptional<z.ZodObject<{
|
|
9
9
|
_class: z.ZodOptional<z.ZodLiteral<"Name">>;
|
|
10
10
|
first_name: z.ZodOptional<z.ZodString>;
|
|
11
|
-
|
|
11
|
+
nickname: z.ZodOptional<z.ZodString>;
|
|
12
12
|
surname: z.ZodOptional<z.ZodString>;
|
|
13
13
|
surname_list: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
14
14
|
_class: z.ZodOptional<z.ZodLiteral<"Surname">>;
|
|
@@ -42,7 +42,7 @@ declare const updatePersonSchema: z.ZodObject<{
|
|
|
42
42
|
surname?: string | undefined;
|
|
43
43
|
primary?: boolean | undefined;
|
|
44
44
|
first_name?: string | undefined;
|
|
45
|
-
|
|
45
|
+
nickname?: string | undefined;
|
|
46
46
|
surname_list?: {
|
|
47
47
|
surname: string;
|
|
48
48
|
_class?: "Surname" | undefined;
|
|
@@ -59,7 +59,7 @@ declare const updatePersonSchema: z.ZodObject<{
|
|
|
59
59
|
surname?: string | undefined;
|
|
60
60
|
primary?: boolean | undefined;
|
|
61
61
|
first_name?: string | undefined;
|
|
62
|
-
|
|
62
|
+
nickname?: string | undefined;
|
|
63
63
|
surname_list?: {
|
|
64
64
|
surname: string;
|
|
65
65
|
_class?: "Surname" | undefined;
|
|
@@ -74,7 +74,7 @@ declare const updatePersonSchema: z.ZodObject<{
|
|
|
74
74
|
alternate_names: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
75
75
|
_class: z.ZodOptional<z.ZodLiteral<"Name">>;
|
|
76
76
|
first_name: z.ZodOptional<z.ZodString>;
|
|
77
|
-
|
|
77
|
+
nickname: z.ZodOptional<z.ZodString>;
|
|
78
78
|
surname: z.ZodOptional<z.ZodString>;
|
|
79
79
|
surname_list: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
80
80
|
_class: z.ZodOptional<z.ZodLiteral<"Surname">>;
|
|
@@ -108,7 +108,7 @@ declare const updatePersonSchema: z.ZodObject<{
|
|
|
108
108
|
surname?: string | undefined;
|
|
109
109
|
primary?: boolean | undefined;
|
|
110
110
|
first_name?: string | undefined;
|
|
111
|
-
|
|
111
|
+
nickname?: string | undefined;
|
|
112
112
|
surname_list?: {
|
|
113
113
|
surname: string;
|
|
114
114
|
_class?: "Surname" | undefined;
|
|
@@ -125,7 +125,7 @@ declare const updatePersonSchema: z.ZodObject<{
|
|
|
125
125
|
surname?: string | undefined;
|
|
126
126
|
primary?: boolean | undefined;
|
|
127
127
|
first_name?: string | undefined;
|
|
128
|
-
|
|
128
|
+
nickname?: string | undefined;
|
|
129
129
|
surname_list?: {
|
|
130
130
|
surname: string;
|
|
131
131
|
_class?: "Surname" | undefined;
|
|
@@ -206,7 +206,7 @@ declare const updatePersonSchema: z.ZodObject<{
|
|
|
206
206
|
surname?: string | undefined;
|
|
207
207
|
primary?: boolean | undefined;
|
|
208
208
|
first_name?: string | undefined;
|
|
209
|
-
|
|
209
|
+
nickname?: string | undefined;
|
|
210
210
|
surname_list?: {
|
|
211
211
|
surname: string;
|
|
212
212
|
_class?: "Surname" | undefined;
|
|
@@ -224,7 +224,7 @@ declare const updatePersonSchema: z.ZodObject<{
|
|
|
224
224
|
surname?: string | undefined;
|
|
225
225
|
primary?: boolean | undefined;
|
|
226
226
|
first_name?: string | undefined;
|
|
227
|
-
|
|
227
|
+
nickname?: string | undefined;
|
|
228
228
|
surname_list?: {
|
|
229
229
|
surname: string;
|
|
230
230
|
_class?: "Surname" | undefined;
|
|
@@ -273,7 +273,7 @@ declare const updatePersonSchema: z.ZodObject<{
|
|
|
273
273
|
surname?: string | undefined;
|
|
274
274
|
primary?: boolean | undefined;
|
|
275
275
|
first_name?: string | undefined;
|
|
276
|
-
|
|
276
|
+
nickname?: string | undefined;
|
|
277
277
|
surname_list?: {
|
|
278
278
|
surname: string;
|
|
279
279
|
_class?: "Surname" | undefined;
|
|
@@ -291,7 +291,7 @@ declare const updatePersonSchema: z.ZodObject<{
|
|
|
291
291
|
surname?: string | undefined;
|
|
292
292
|
primary?: boolean | undefined;
|
|
293
293
|
first_name?: string | undefined;
|
|
294
|
-
|
|
294
|
+
nickname?: string | undefined;
|
|
295
295
|
surname_list?: {
|
|
296
296
|
surname: string;
|
|
297
297
|
_class?: "Surname" | undefined;
|
|
@@ -543,7 +543,7 @@ export declare const updateTools: {
|
|
|
543
543
|
surname: {
|
|
544
544
|
type: string;
|
|
545
545
|
};
|
|
546
|
-
|
|
546
|
+
nickname: {
|
|
547
547
|
type: string;
|
|
548
548
|
description: string;
|
|
549
549
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/tools/update.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAexB,QAAA,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBtB,CAAC;AAGH,QAAA,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBtB,CAAC;AAeH;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,GACzC,OAAO,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/tools/update.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAexB,QAAA,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBtB,CAAC;AAGH,QAAA,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBtB,CAAC;AAeH;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,GACzC,OAAO,CAAC,MAAM,CAAC,CAkIjB;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,GACzC,OAAO,CAAC,MAAM,CAAC,CAwHjB;AAGD,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkHvB,CAAC"}
|
package/dist/tools/update.js
CHANGED
|
@@ -75,17 +75,28 @@ export async function grampsUpdatePerson(params) {
|
|
|
75
75
|
};
|
|
76
76
|
// Handle primary_name update
|
|
77
77
|
if (updateFields.primary_name) {
|
|
78
|
-
|
|
78
|
+
const nameData = { ...updateFields.primary_name };
|
|
79
|
+
// Map nickname to call_name (API field name)
|
|
80
|
+
if (nameData.nickname) {
|
|
81
|
+
nameData.call_name = nameData.nickname;
|
|
82
|
+
delete nameData.nickname;
|
|
83
|
+
}
|
|
84
|
+
updatedPerson.primary_name = { _class: "Name", ...nameData };
|
|
79
85
|
}
|
|
80
86
|
else {
|
|
81
87
|
updatedPerson.primary_name = existing.primary_name;
|
|
82
88
|
}
|
|
83
89
|
// Handle alternate_names update
|
|
84
90
|
if (updateFields.alternate_names) {
|
|
85
|
-
updatedPerson.alternate_names = updateFields.alternate_names.map((n) =>
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
91
|
+
updatedPerson.alternate_names = updateFields.alternate_names.map((n) => {
|
|
92
|
+
const nameData = { ...n };
|
|
93
|
+
// Map nickname to call_name (API field name)
|
|
94
|
+
if (nameData.nickname) {
|
|
95
|
+
nameData.call_name = nameData.nickname;
|
|
96
|
+
delete nameData.nickname;
|
|
97
|
+
}
|
|
98
|
+
return { _class: "Name", ...nameData };
|
|
99
|
+
});
|
|
89
100
|
}
|
|
90
101
|
else {
|
|
91
102
|
updatedPerson.alternate_names = existing.alternate_names;
|
|
@@ -289,7 +300,7 @@ export const updateTools = {
|
|
|
289
300
|
properties: {
|
|
290
301
|
first_name: { type: "string" },
|
|
291
302
|
surname: { type: "string" },
|
|
292
|
-
|
|
303
|
+
nickname: { type: "string", description: "Nickname (also known as call name)" },
|
|
293
304
|
suffix: { type: "string" },
|
|
294
305
|
title: { type: "string" },
|
|
295
306
|
},
|