@edda-business/mcp 0.58.0 → 0.59.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/package.json +1 -1
- package/src/server.js +24 -27
package/package.json
CHANGED
package/src/server.js
CHANGED
|
@@ -691,44 +691,41 @@ export function createServer() {
|
|
|
691
691
|
);
|
|
692
692
|
|
|
693
693
|
// ===========================================================================
|
|
694
|
-
// TOOL: propose_company_file — POST /v2/company/
|
|
694
|
+
// TOOL: propose_company_file — POST /v2/company/pages
|
|
695
695
|
// The WRITE side of the company vault (search_company_knowledge is the read side).
|
|
696
|
-
//
|
|
697
|
-
//
|
|
696
|
+
// Writes an in-app company page directly (no GitHub). Members with a write role
|
|
697
|
+
// publish it live; viewers land it in the company inbox for an admin to approve.
|
|
698
698
|
// ===========================================================================
|
|
699
699
|
server.tool(
|
|
700
700
|
"propose_company_file",
|
|
701
|
-
"
|
|
701
|
+
"Add a markdown page to the SHARED COMPANY vault — the workspace's declared knowledge " +
|
|
702
702
|
"(policies, playbooks, decisions, SOPs, how-we-work) that every member's agent can read via " +
|
|
703
|
-
"search_company_knowledge. This
|
|
704
|
-
"
|
|
705
|
-
"
|
|
706
|
-
"
|
|
707
|
-
"
|
|
708
|
-
"NOT the member's private notes (use propose_vault_file), NOT a note on a contact (use save_note).",
|
|
703
|
+
"search_company_knowledge. This writes the page IN-APP: a member with a write role publishes " +
|
|
704
|
+
"it live immediately; a viewer's page lands in the company inbox for an admin to approve. Set " +
|
|
705
|
+
"`visibility` to scope who sees it — 'company' (everyone, the default), 'department' (the team), " +
|
|
706
|
+
"or 'owner' (just you). Use it to contribute company-wide knowledge. " +
|
|
707
|
+
"NOT the member's private vault (use save_to_vault), NOT a note on a contact (use save_note).",
|
|
709
708
|
{
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
message: z.string().optional().describe("Optional PR title / commit message describing the change."),
|
|
715
|
-
pr_group: z.string().optional().describe("Optional key to batch several proposals from one work session into a SINGLE pull request (same key → same PR)."),
|
|
709
|
+
name: z.string().describe("The page name, e.g. 'Refund Policy' or 'Q3 Planning — 2026-08-22'. A '.md' suffix is added if missing."),
|
|
710
|
+
content: z.string().describe("The full markdown content of the page."),
|
|
711
|
+
visibility: z.enum(["owner", "department", "company"]).optional().describe("Who can see the page: 'company' (everyone — default), 'department' (the team), or 'owner' (just you)."),
|
|
712
|
+
folder_id: z.string().optional().describe("Optional id of an existing company folder to file under. Omit to land it in the default 'wiki' folder."),
|
|
716
713
|
},
|
|
717
|
-
async ({
|
|
714
|
+
async ({ name, content, visibility, folder_id }) => {
|
|
718
715
|
try {
|
|
719
|
-
const r = await post("/v2/company/
|
|
720
|
-
const
|
|
721
|
-
|
|
716
|
+
const r = await post("/v2/company/pages", { name, content, visibility: visibility ?? "company", folder_id });
|
|
717
|
+
const live = r?.page?.status === "live";
|
|
718
|
+
const where = live
|
|
719
|
+
? `published live to the company vault — searchable now`
|
|
720
|
+
: `sent to the company inbox for an admin to approve`;
|
|
721
|
+
return { content: [{ type: "text", text: `"${r?.page?.name ?? name}" ${where}.` }] };
|
|
722
722
|
} catch (e) {
|
|
723
723
|
const msg = String(e?.message || e);
|
|
724
|
-
if (msg.includes("
|
|
725
|
-
return { content: [{ type: "text", text: `Not
|
|
726
|
-
}
|
|
727
|
-
if (msg.includes("no_company_repo")) {
|
|
728
|
-
return { content: [{ type: "text", text: `Not proposed — no company GitHub repo is connected. An admin connects one under Company vault first.` }] };
|
|
724
|
+
if (msg.includes("forbidden") || msg.includes("(403)")) {
|
|
725
|
+
return { content: [{ type: "text", text: `Not saved — you don't have access to write to this company vault.` }] };
|
|
729
726
|
}
|
|
730
|
-
if (msg.includes("
|
|
731
|
-
return { content: [{ type: "text", text: `Not
|
|
727
|
+
if (msg.includes("bad_folder")) {
|
|
728
|
+
return { content: [{ type: "text", text: `Not saved — that folder_id isn't a company folder in this workspace. Omit it to use the default 'wiki' folder.` }] };
|
|
732
729
|
}
|
|
733
730
|
throw e;
|
|
734
731
|
}
|