@edda-business/mcp 0.66.1 → 0.67.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/server.js +37 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edda-business/mcp",
3
- "version": "0.66.1",
3
+ "version": "0.67.0",
4
4
  "description": "Edda — the company data layer for AI agents.",
5
5
  "license": "Apache-2.0",
6
6
  "publishConfig": {
package/src/server.js CHANGED
@@ -197,6 +197,43 @@ export function createServer() {
197
197
 
198
198
  // EfB read-only seat mode stops here: tools/list is exactly search + read, and the write
199
199
  // tools below don't exist for the seat at all (unavailable, not merely rejected).
200
+ // ===========================================================================
201
+ // TOOL: orientation — GET /v2/company/orientation
202
+ // The served hot-cache: what is active right now, before you search.
203
+ // ===========================================================================
204
+ server.tool(
205
+ "orientation",
206
+ "START HERE at the beginning of a session: one cheap call that answers 'what is active in " +
207
+ "this company right now?' — each project with its status and its Current-state excerpt " +
208
+ "(from the project's index.md), the most recently updated pages, and how many items wait in " +
209
+ "the Inbox. Use it to orient BEFORE searching; then open the relevant project's index.md or " +
210
+ "search for specifics.",
211
+ {},
212
+ async () => {
213
+ try {
214
+ const r = await get("/v2/company/orientation");
215
+ const lines = [];
216
+ const projects = r?.projects ?? [];
217
+ lines.push(`Active projects (${projects.length}):`);
218
+ for (const p of projects) {
219
+ lines.push(`\n• ${p.name}${p.status ? ` [${p.status}]` : ""}`);
220
+ lines.push(p.current_state ? ` ${p.current_state.replace(/\n/g, "\n ")}` : " (no current-state entries yet)");
221
+ }
222
+ const recent = r?.recent_pages ?? [];
223
+ if (recent.length) {
224
+ lines.push(`\nRecently updated:`);
225
+ for (const pg of recent) lines.push(` · ${[pg.folder, pg.name].filter(Boolean).join("/")} (${String(pg.updated_at).slice(0, 10)})`);
226
+ }
227
+ lines.push(`\nInbox: ${r?.inbox_pending ?? 0} item(s) waiting.`);
228
+ return text(lines.join("\n"));
229
+ } catch (e) {
230
+ const msg = String(e?.message || e);
231
+ if (msg.includes("(404)")) return text("Orientation isn't available on this company's server yet — fall back to search.");
232
+ throw e;
233
+ }
234
+ },
235
+ );
236
+
200
237
  if (readOnly) return server;
201
238
 
202
239
  // ===========================================================================