@limeadelabs/launchpad-mcp 1.2.2 → 1.2.3
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/index.js +17 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -402,7 +402,7 @@ function registerPageTools(server2, client2) {
|
|
|
402
402
|
try {
|
|
403
403
|
const result = await client2.listPages(params.project_id);
|
|
404
404
|
const pages = result.pages ?? result;
|
|
405
|
-
const summary = Array.isArray(pages) ? pages.map(({ id, title, author, created_at, updated_at }) => ({ id, title, author, created_at, updated_at })) : pages;
|
|
405
|
+
const summary = Array.isArray(pages) ? pages.map(({ id, title, project, author, created_at, updated_at }) => ({ id, title, project_id: project?.id, project_name: project?.name, author, created_at, updated_at })) : pages;
|
|
406
406
|
return { content: [{ type: "text", text: JSON.stringify(summary, null, 2) }] };
|
|
407
407
|
} catch (error) {
|
|
408
408
|
return handleError(error, client2.timeoutMs);
|
|
@@ -411,9 +411,9 @@ function registerPageTools(server2, client2) {
|
|
|
411
411
|
);
|
|
412
412
|
server2.tool(
|
|
413
413
|
"lp_get_page",
|
|
414
|
-
"Get a page's full content
|
|
414
|
+
"Get a page's full content. Accepts page_id or id. project_id is optional \u2014 if omitted, it will be inferred automatically.",
|
|
415
415
|
{
|
|
416
|
-
project_id: z7.coerce.number().describe("Project ID"),
|
|
416
|
+
project_id: z7.coerce.number().optional().describe("Project ID (optional \u2014 inferred if omitted)"),
|
|
417
417
|
page_id: z7.coerce.number().optional().describe("Page ID"),
|
|
418
418
|
id: z7.coerce.number().optional().describe("Page ID (alias for page_id)")
|
|
419
419
|
},
|
|
@@ -421,8 +421,20 @@ function registerPageTools(server2, client2) {
|
|
|
421
421
|
try {
|
|
422
422
|
const pageId = params.page_id ?? params.id;
|
|
423
423
|
if (!pageId) throw new Error("page_id or id is required");
|
|
424
|
-
|
|
425
|
-
|
|
424
|
+
if (params.project_id) {
|
|
425
|
+
const result = await client2.getPage(params.project_id, pageId);
|
|
426
|
+
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
427
|
+
}
|
|
428
|
+
const projectsResult = await client2.listProjects();
|
|
429
|
+
const projects = projectsResult.projects ?? projectsResult;
|
|
430
|
+
for (const proj of Array.isArray(projects) ? projects : []) {
|
|
431
|
+
try {
|
|
432
|
+
const result = await client2.getPage(proj.id, pageId);
|
|
433
|
+
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
434
|
+
} catch {
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
throw new Error(`Page ${pageId} not found in any accessible project`);
|
|
426
438
|
} catch (error) {
|
|
427
439
|
return handleError(error, client2.timeoutMs);
|
|
428
440
|
}
|