@loopops/mcp-server 2.6.0 → 2.7.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/tools/company-graph.js +62 -0
- package/package.json +1 -1
|
@@ -101,4 +101,66 @@ export function registerCompanyGraphTools(server, allowed) {
|
|
|
101
101
|
.describe("If true, drain the queue via the matcher immediately after insert."),
|
|
102
102
|
}, safeTool(async (input) => trpcMutation("mcp.importAccountsCsv", input)));
|
|
103
103
|
}
|
|
104
|
+
if (allowed.has("show_cg_config")) {
|
|
105
|
+
server.tool("show_cg_config", [
|
|
106
|
+
"Read the current contents of a Company Graph YAML config from the repo.",
|
|
107
|
+
"Use this before update_cg_config to see the current state. Today only",
|
|
108
|
+
"`resolution_rules` exists; future entries (e.g. sfdc_field_map) join the enum.",
|
|
109
|
+
].join(" "), {
|
|
110
|
+
file: z
|
|
111
|
+
.enum(["resolution_rules"])
|
|
112
|
+
.describe("Which file under config/cg/ to read. Today only resolution_rules."),
|
|
113
|
+
}, safeTool(async (input) => trpcQuery("mcp.showCgConfig", input)));
|
|
114
|
+
}
|
|
115
|
+
if (allowed.has("sync_cg_resolution_rules")) {
|
|
116
|
+
server.tool("sync_cg_resolution_rules", [
|
|
117
|
+
"Apply the committed config/cg/resolution_rules.yaml to the DB.",
|
|
118
|
+
"Server-side equivalent of `node scripts/cg-sync-resolution-rules.mjs --resolve`.",
|
|
119
|
+
"Idempotent — re-running with no YAML changes is a no-op. Pair with",
|
|
120
|
+
"update_cg_config to complete an edit→commit→apply cycle from one Claude",
|
|
121
|
+
"session, no local clone needed. Resolver backfills golden records by default.",
|
|
122
|
+
].join(" "), {
|
|
123
|
+
branch: z
|
|
124
|
+
.string()
|
|
125
|
+
.optional()
|
|
126
|
+
.describe("Branch to read YAML from. Default: main. Useful for testing a feature branch's YAML before merging."),
|
|
127
|
+
resolve: z
|
|
128
|
+
.boolean()
|
|
129
|
+
.optional()
|
|
130
|
+
.describe("Re-run the resolver across affected accounts after applying rule changes so golden records update. Default: true."),
|
|
131
|
+
dryRun: z
|
|
132
|
+
.boolean()
|
|
133
|
+
.optional()
|
|
134
|
+
.describe("Read + validate + diff against DB without writing. Useful for previewing."),
|
|
135
|
+
}, safeTool(async (input) => trpcMutation("mcp.syncCgResolutionRules", input)));
|
|
136
|
+
}
|
|
137
|
+
if (allowed.has("update_cg_config")) {
|
|
138
|
+
server.tool("update_cg_config", [
|
|
139
|
+
"Edit a Company Graph YAML config by committing the new content to the repo",
|
|
140
|
+
"via the GitHub API (same pattern as update_config for per-loop configs).",
|
|
141
|
+
"Workflow: read the current file with show_cg_config, edit, send back via this tool.",
|
|
142
|
+
"Commit goes to the target branch (default `main`); Vercel auto-deploys.",
|
|
143
|
+
"After commit, run `node scripts/cg-sync-resolution-rules.mjs --resolve`",
|
|
144
|
+
"from a local clone to apply the change to the DB and backfill golden records.",
|
|
145
|
+
"There's no direct DB-write path — YAML is the single source of truth, drift is",
|
|
146
|
+
"structurally impossible.",
|
|
147
|
+
].join(" "), {
|
|
148
|
+
file: z
|
|
149
|
+
.enum(["resolution_rules"])
|
|
150
|
+
.describe("Which file under config/cg/ to update. Today only resolution_rules."),
|
|
151
|
+
content: z
|
|
152
|
+
.string()
|
|
153
|
+
.min(1)
|
|
154
|
+
.describe("Full new YAML content (the tool replaces the file wholesale). Run show_cg_config first to read, then edit, then send back."),
|
|
155
|
+
message: z
|
|
156
|
+
.string()
|
|
157
|
+
.min(3)
|
|
158
|
+
.max(72)
|
|
159
|
+
.describe("Git commit message. Convention: `cg: <what changed and why>` (e.g. 'cg: drop annual_revenue min_confidence to 40 — pdl coverage sparse')."),
|
|
160
|
+
branch: z
|
|
161
|
+
.string()
|
|
162
|
+
.optional()
|
|
163
|
+
.describe("Target branch. Default: main. Pass a feature branch if you want review-before-merge."),
|
|
164
|
+
}, safeTool(async (input) => trpcMutation("mcp.updateCgConfig", input)));
|
|
165
|
+
}
|
|
104
166
|
}
|