mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-04 18:34:02 +00:00
situation_brief, military_awareness and the HUD caption called other tools directly, so replaced tools and interceptors did not apply to their sections. Tools now reach each other through the catalog, and interceptors see these calls with the calling tool as parent. Surfaces become a view over the composed catalog, so a composite offered on voice keeps sections that voice does not list.
38 lines
1.1 KiB
JavaScript
38 lines
1.1 KiB
JavaScript
/** The local MCP server: Core's tools over services backed by a running app. */
|
|
|
|
import { readFileSync } from 'node:fs';
|
|
import {
|
|
composeCatalog,
|
|
coreTools,
|
|
catalogForSurface,
|
|
} from '../../src/tools/index.js';
|
|
import { createMcpServer } from '../../src/tools/mcp/index.js';
|
|
import { DEFAULT_API_BASE, createLocalToolServices } from './services.js';
|
|
|
|
const INSTRUCTIONS =
|
|
"Tools answer questions from God's Eye View's live public data. Location " +
|
|
'tools take an area: a place name, a bbox, or lat/lon with radius_km. ' +
|
|
'Results are capped; check truncated and total before concluding there is nothing more.';
|
|
|
|
/** Construct the local MCP server for Core's tools. */
|
|
export function createLocalMcpServer({
|
|
apiBase = DEFAULT_API_BASE,
|
|
fetchImpl,
|
|
} = {}) {
|
|
const { version } = JSON.parse(
|
|
readFileSync(new URL('../../package.json', import.meta.url), 'utf8'),
|
|
);
|
|
return createMcpServer({
|
|
catalog: catalogForSurface(
|
|
composeCatalog({
|
|
tools: coreTools,
|
|
services: createLocalToolServices({ apiBase, fetchImpl }),
|
|
}),
|
|
'mcp',
|
|
),
|
|
name: 'gods-eye-view',
|
|
version,
|
|
instructions: INSTRUCTIONS,
|
|
});
|
|
}
|