@littlebigbrain/mcp 0.12.0 → 0.13.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.js +70 -7
- package/package.json +2 -2
package/dist/tools.js
CHANGED
|
@@ -358,7 +358,7 @@ export function registerLbbTools(server, client, options = {}) {
|
|
|
358
358
|
});
|
|
359
359
|
});
|
|
360
360
|
server.registerTool("lbb_models", {
|
|
361
|
-
description: "Read model-training inputs or compare retrieval configurations over one pinned published snapshot, or read what the managed models did. shadow_eval takes the API ShadowEvalRequest body; dataset actions return bounded training examples at an optional signal split. activity reads one month of the stack's model use (all graphs): calls, items, estimated tokens and cost per feature (index, search, fit, judge, training) and model, by day and by graph, the months with activity, and the model each feature uses now.",
|
|
361
|
+
description: "Read model-training inputs or compare retrieval configurations over one pinned published snapshot, or read what the managed models did. shadow_eval takes the API ShadowEvalRequest body; dataset actions return bounded training examples at an optional signal split. activity reads one month of the stack's model use (all graphs): calls, items, estimated tokens and cost per feature (index, search, fit, judge, training, rerank, rewrite, trial, workflows) and model, by day and by graph, the workflows' calls per workflow and job (by_workflow), the months with activity, and the model each feature uses now.",
|
|
362
362
|
inputSchema: {
|
|
363
363
|
action: z.enum([
|
|
364
364
|
"shadow_eval",
|
|
@@ -691,7 +691,7 @@ export function registerLbbTools(server, client, options = {}) {
|
|
|
691
691
|
return { starter: args.starter, name: args.name };
|
|
692
692
|
};
|
|
693
693
|
server.registerTool("lbb_workflows", {
|
|
694
|
-
description: "Starter workflows and triggered workflows, read only. A starter workflow is a template; a triggered workflow is a workflow created from one on the graph. It watches a class: when a published commit adds or changes instances of the class (or changes the watched fields), the workflow reads them and does its work. search.embed keeps an embedding of the class (the same as lbb_embeddings); ontology.fit reads text fields and files ontology suggestions (the same as lbb_fit_sources); workflow (a developer workflow) sends the new and changed instances to a workflow of the developer's worker as trigger messages, and that code writes the facts the workflow owns. documents.parse reads uploaded PDF files into pages with line boxes, documents.link writes DocEntry and DocMention instances and links each mention to
|
|
694
|
+
description: "Starter workflows and triggered workflows, read only. A starter workflow is a template; a triggered workflow is a workflow created from one on the graph. It watches a class: when a published commit adds or changes instances of the class (or changes the watched fields), the workflow reads them and does its work. search.embed keeps an embedding of the class (the same as lbb_embeddings); ontology.fit reads text fields and files ontology suggestions (the same as lbb_fit_sources); workflow (a developer workflow) sends the new and changed instances to a workflow of the developer's worker as trigger messages, and that code writes the facts the workflow owns. documents.parse reads uploaded PDF files into pages with line boxes, documents.link connects mentions of the same thing across the documents (it writes DocEntry and DocMention instances and links each mention to the entry that defines or describes it), documents.map proposes each link as a FactProposal in the graph's own ontology (fact_subject, fact_predicate, fact_object, fact_confidence, fact_evidence) for a review workflow, and values.extract fills chosen properties from text, each value with a quote; read the files and their pages with lbb_files. starters lists the starter workflows this server offers with their group, settings and whether each can run here. list shows every triggered workflow of the graph with its state (backfilling, ready, paused, failed, unavailable), lag, counters, this month's spend and last error; get shows one (starter and name) with its own status in details (for workflow: the messages sent, the instances waiting, the message in flight and whether it is paused). preview shows what creating one would do (the resolved watch, the instance count and the workflow's own preview; for workflow, the first messages it would send), calls no model and stores nothing. Message workflows of the workflow engine are not listed here. Create, refresh, pause or resume with lbb_workflows_manage; delete with lbb_workflows_delete.",
|
|
695
695
|
inputSchema: {
|
|
696
696
|
action: z.enum(["starters", "list", "get", "preview"]),
|
|
697
697
|
name: z
|
|
@@ -732,7 +732,7 @@ export function registerLbbTools(server, client, options = {}) {
|
|
|
732
732
|
}
|
|
733
733
|
}));
|
|
734
734
|
server.registerTool("lbb_workflows_manage", {
|
|
735
|
-
description: "Create a workflow from a starter workflow, or refresh, pause or resume a triggered workflow. Run lbb_workflows action=preview first and show the user the watch and the instance count. use creates a workflow from a starter workflow of action=starters, under a name (default: the class's local name), with its watch (class, fields) and params; the workflow then reads every instance of the class and follows each published commit. A developer workflow (starter=workflow) also takes workflow (workflow_type and version of the developer's worker), owns and batch; it needs a server with the workflow engine. use again with the same starter and name changes only what you name, and the same request again changes nothing. A workflow that calls models (ontology.fit, documents.link,
|
|
735
|
+
description: "Create a workflow from a starter workflow, or refresh, pause or resume a triggered workflow. Run lbb_workflows action=preview first and show the user the watch and the instance count. use creates a workflow from a starter workflow of action=starters, under a name (default: the class's local name), with its watch (class, fields) and params; the workflow then reads every instance of the class and follows each published commit. A developer workflow (starter=workflow) also takes workflow (workflow_type and version of the developer's worker), owns and batch; it needs a server with the workflow engine. use again with the same starter and name changes only what you name, and the same request again changes nothing. A workflow that calls models (ontology.fit, documents.link, documents.map, values.extract) spends model budget as it reads. refresh asks the workflow to run now and returns at once with queued; poll lbb_workflows action=get for progress. pause stops a workflow (a developer workflow, documents.parse, documents.link, documents.map or values.extract) from reading and sending; resume lets it catch up. search.embed and ontology.fit cannot be paused.",
|
|
736
736
|
inputSchema: {
|
|
737
737
|
action: z.enum(["use", "refresh", "pause", "resume"]),
|
|
738
738
|
name: z
|
|
@@ -921,7 +921,7 @@ export function registerLbbTools(server, client, options = {}) {
|
|
|
921
921
|
}
|
|
922
922
|
}));
|
|
923
923
|
server.registerTool("lbb_evals", {
|
|
924
|
-
description: "Managed evals: ground truth for the questions an app asks and the searches it runs. A query run with `request` (lbb_query, also mode=question) records a trace: the question, the query that answered it, the type of that query (`query_type`: sparql, hybrid = search by meaning with conditions, search = search by meaning alone) and one item per result (hit or row); trace reads it back with the item ids. label has two forms. On a question's trace, valid alone judges the whole answer: valid=true makes the trace's query the golden query of the question; valid=false with sparql gives the right query, which becomes the golden query; valid=false alone marks the answer wrong. item + valid (or items) judges one result, a citation of the answer: the ground truth of the hits of a search by meaning, and a result marked wrong must not come back for any type. golden freezes a stored query or a search (every result it returns now is relevant). run checks every golden at the current commit: a question is asked again through the query rewriter, then the type of the query it wrote is compared with the expected type, its rows with the rows of the golden query at the same commit (`query_check`), and its results with the judged results; a search is done again; new results open a review trace. judge lets the platform's judge model (the hosted frontier model) label unlabeled results. summary, traces, goldens, results, and settings read state. Model checks: a judge model checks a sample of the model calls LBB makes for the graph (rerank, route, ask = the answer of a question, rewrite, fit, propose, label). checks_summary reads a month per job and model (checks, score, right, partly, wrong, reviews) and the judge's agreement with people; checks lists the month's checks, newest first, with the judge's verdict, score and reason and the ground truth (`truth`). review_check records a person's review of one check (call_id): agree=true keeps the judge's verdict; agree=false with verdict (and an optional score, reference and note) corrects it. The review becomes the call's ground truth, so show the check to the user and review only what the user confirmed.",
|
|
924
|
+
description: "Managed evals: ground truth for the questions an app asks and the searches it runs. A query run with `request` (lbb_query, also mode=question) records a trace: the question, the query that answered it, the type of that query (`query_type`: sparql, hybrid = search by meaning with conditions, search = search by meaning alone) and one item per result (hit or row); trace reads it back with the item ids. label has two forms. On a question's trace, valid alone judges the whole answer: valid=true makes the trace's query the golden query of the question; valid=false with sparql gives the right query, which becomes the golden query; valid=false alone marks the answer wrong; route with valid=true (or valid=false with sparql) names the route the question expects, and valid=true alone takes the trace's route. item + valid (or items) judges one result, a citation of the answer: the ground truth of the hits of a search by meaning, and a result marked wrong must not come back for any type. golden freezes a stored query or a search (every result it returns now is relevant). run checks every golden at the current commit: a question is asked again through the query rewriter, then the type of the query it wrote is compared with the expected type, its rows with the rows of the golden query at the same commit (`query_check`), and its results with the judged results, and the router's pick with the golden's route (route_check, which does not change the verdict); a search is done again; new results open a review trace. run_answers checks your own app's answers instead: ask each question golden's request with your own loop, then send answers=[{golden, sparql, route}] (route = the route of lbb_query mode=question with route mode, sparql absent for an unanswerable question, error for a failure); the server runs each query and checks it the same way, and the runs form the app's own series (runner; results with runner reads them). judge lets the platform's judge model (the hosted frontier model) label unlabeled results. summary, traces, goldens, results, and settings read state. Model checks: a judge model checks a sample of the model calls LBB makes for the graph (rerank, route, ask = the answer of a question, rewrite, fit, propose, label). checks_summary reads a month per job and model (checks, score, right, partly, wrong, reviews) and the judge's agreement with people; checks lists the month's checks, newest first, with the judge's verdict, score and reason and the ground truth (`truth`). review_check records a person's review of one check (call_id): agree=true keeps the judge's verdict; agree=false with verdict (and an optional score, reference and note) corrects it. The review becomes the call's ground truth, so show the check to the user and review only what the user confirmed.",
|
|
925
925
|
inputSchema: {
|
|
926
926
|
action: z.enum([
|
|
927
927
|
"summary",
|
|
@@ -934,6 +934,7 @@ export function registerLbbTools(server, client, options = {}) {
|
|
|
934
934
|
"accept",
|
|
935
935
|
"delete",
|
|
936
936
|
"run",
|
|
937
|
+
"run_answers",
|
|
937
938
|
"results",
|
|
938
939
|
"settings",
|
|
939
940
|
"checks_summary",
|
|
@@ -974,6 +975,58 @@ export function registerLbbTools(server, client, options = {}) {
|
|
|
974
975
|
.string()
|
|
975
976
|
.optional()
|
|
976
977
|
.describe("golden: the query to freeze (the search text for surface=search). label: with valid=false and no item, the right query for the question; the server checks and runs it once."),
|
|
978
|
+
route: z
|
|
979
|
+
.enum([
|
|
980
|
+
"lookup",
|
|
981
|
+
"aggregate",
|
|
982
|
+
"search",
|
|
983
|
+
"history",
|
|
984
|
+
"schema",
|
|
985
|
+
"unanswerable",
|
|
986
|
+
])
|
|
987
|
+
.optional()
|
|
988
|
+
.describe("label: with valid=true, or valid=false with sparql, the route the question expects."),
|
|
989
|
+
answers: z
|
|
990
|
+
.array(z
|
|
991
|
+
.object({
|
|
992
|
+
golden: z.string().min(1),
|
|
993
|
+
sparql: z.string().optional(),
|
|
994
|
+
entailment: z
|
|
995
|
+
.enum(["none", "subclass", "rdfs", "owl"])
|
|
996
|
+
.optional(),
|
|
997
|
+
as_of_commit_seq: z.number().int().nonnegative().optional(),
|
|
998
|
+
route: z
|
|
999
|
+
.object({
|
|
1000
|
+
kind: z.enum([
|
|
1001
|
+
"lookup",
|
|
1002
|
+
"aggregate",
|
|
1003
|
+
"search",
|
|
1004
|
+
"history",
|
|
1005
|
+
"schema",
|
|
1006
|
+
"unanswerable",
|
|
1007
|
+
]),
|
|
1008
|
+
confidence: z.number(),
|
|
1009
|
+
by: z.enum(["caller", "router", "rewriter"]),
|
|
1010
|
+
probabilities: z.record(z.string(), z.number()).optional(),
|
|
1011
|
+
})
|
|
1012
|
+
.strict()
|
|
1013
|
+
.optional(),
|
|
1014
|
+
reply: z
|
|
1015
|
+
.object({
|
|
1016
|
+
text: z.string(),
|
|
1017
|
+
citations: z.array(z.string()).optional(),
|
|
1018
|
+
})
|
|
1019
|
+
.optional(),
|
|
1020
|
+
error: z.string().optional(),
|
|
1021
|
+
cost_micro_usd: z.number().int().nonnegative().optional(),
|
|
1022
|
+
})
|
|
1023
|
+
.strict())
|
|
1024
|
+
.optional()
|
|
1025
|
+
.describe("run_answers: one answer per question golden your app asked: golden (its id), sparql (the query whose rows hold the answer; leave it out when the question is unanswerable), entailment, as_of_commit_seq, route (as the router returned it), reply, error (your app failed), cost_micro_usd."),
|
|
1026
|
+
runner: z
|
|
1027
|
+
.string()
|
|
1028
|
+
.optional()
|
|
1029
|
+
.describe("run_answers / results: your app's name, lower-case letters, digits and -, at most 40 characters (default app). results without runner reads the server's runs."),
|
|
977
1030
|
surface: z
|
|
978
1031
|
.enum(["sparql", "search"])
|
|
979
1032
|
.optional()
|
|
@@ -1005,7 +1058,7 @@ export function registerLbbTools(server, client, options = {}) {
|
|
|
1005
1058
|
consistency: z
|
|
1006
1059
|
.enum(["strong", "eventual"])
|
|
1007
1060
|
.optional()
|
|
1008
|
-
.describe("run / accept: strong reads the head, eventual the last published commit."),
|
|
1061
|
+
.describe("run / run_answers / accept: strong reads the head, eventual the last published commit."),
|
|
1009
1062
|
month: yearMonthSchema
|
|
1010
1063
|
.optional()
|
|
1011
1064
|
.describe("checks_summary / checks: the month, yyyy-mm (UTC). Defaults to the current month."),
|
|
@@ -1054,7 +1107,7 @@ export function registerLbbTools(server, client, options = {}) {
|
|
|
1054
1107
|
...graphScope,
|
|
1055
1108
|
},
|
|
1056
1109
|
annotations: MUTATING,
|
|
1057
|
-
}, ({ action, trace_id, item, valid, items, by, note, sparql, surface, embedding, top_k, request, golden_id, limit, unlabeled, consistency, month, job, verdict, reviewed, after, call_id, agree, score, reference, detail, graph, }) => run(client, `lbb_evals.${action}`, detail, () => {
|
|
1110
|
+
}, ({ action, trace_id, item, valid, items, by, note, sparql, route, answers, runner, surface, embedding, top_k, request, golden_id, limit, unlabeled, consistency, month, job, verdict, reviewed, after, call_id, agree, score, reference, detail, graph, }) => run(client, `lbb_evals.${action}`, detail, () => {
|
|
1058
1111
|
const target = scoped(client, graph);
|
|
1059
1112
|
switch (action) {
|
|
1060
1113
|
case "summary":
|
|
@@ -1075,12 +1128,18 @@ export function registerLbbTools(server, client, options = {}) {
|
|
|
1075
1128
|
if (sparql !== undefined &&
|
|
1076
1129
|
(item || items?.length || valid !== false))
|
|
1077
1130
|
throw new Error("label takes sparql (the right query) only with valid=false and no item");
|
|
1131
|
+
if (route !== undefined &&
|
|
1132
|
+
(item ||
|
|
1133
|
+
items?.length ||
|
|
1134
|
+
(valid !== true && sparql === undefined)))
|
|
1135
|
+
throw new Error("label takes route only with valid=true, or valid=false with sparql, and no item");
|
|
1078
1136
|
return target.evals.label(trace_id, {
|
|
1079
1137
|
...(item ? { item, valid } : {}),
|
|
1080
1138
|
...(items?.length ? { items } : {}),
|
|
1081
1139
|
// The answer of a question as a whole.
|
|
1082
1140
|
...(!item && !items?.length ? { valid } : {}),
|
|
1083
1141
|
...(sparql !== undefined ? { sparql } : {}),
|
|
1142
|
+
...(route !== undefined ? { route } : {}),
|
|
1084
1143
|
by,
|
|
1085
1144
|
note,
|
|
1086
1145
|
});
|
|
@@ -1110,8 +1169,12 @@ export function registerLbbTools(server, client, options = {}) {
|
|
|
1110
1169
|
return target.evals.deleteGolden(golden_id);
|
|
1111
1170
|
case "run":
|
|
1112
1171
|
return target.evals.run({ consistency });
|
|
1172
|
+
case "run_answers":
|
|
1173
|
+
if (!answers?.length)
|
|
1174
|
+
throw new Error("run_answers requires answers");
|
|
1175
|
+
return target.evals.runAnswers({ answers, ...(runner ? { runner } : {}) }, { consistency });
|
|
1113
1176
|
case "results":
|
|
1114
|
-
return target.evals.results({ limit });
|
|
1177
|
+
return target.evals.results({ limit, runner });
|
|
1115
1178
|
case "settings":
|
|
1116
1179
|
return target.evals.settings();
|
|
1117
1180
|
case "checks_summary":
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@littlebigbrain/mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "MCP server for little big brain: search, graph queries, and data import",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"test:coverage": "npm run clean:test && tsc -p tsconfig.test.json && node --test --experimental-test-coverage --test-coverage-include=test-dist/*.js --test-coverage-exclude=test-dist/*.test.js --test-coverage-exclude=test-dist/stdio.js --test-coverage-exclude=test-dist/test-support.js --test-coverage-lines=90 --test-coverage-branches=70 --test-coverage-functions=85 \"test-dist/**/*.test.js\""
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@littlebigbrain/client": "^0.
|
|
55
|
+
"@littlebigbrain/client": "^0.25.0",
|
|
56
56
|
"@modelcontextprotocol/sdk": "^1",
|
|
57
57
|
"zod": "^3"
|
|
58
58
|
},
|