import { ConfigService } from "@nestjs/config"; import { GraphCatalogService } from "../../agents/graph/services/graph.catalog.service"; import { ReadEntityTool } from "../../agents/graph/tools/read-entity.tool"; import { SearchEntitiesTool } from "../../agents/graph/tools/search-entities.tool"; import type { McpToolDefinition, McpUserContext } from "../interfaces/mcp.tool.interface"; import { McpEntityWriteService } from "./mcp.entity.write.service"; /** * Maps an entity-descriptor field (as exposed by the graph catalog) to a JSON * Schema property for MCP tool input schemas. * * Date and datetime fields are advertised as ISO strings on the wire * (`format: "date"` / `format: "date-time"`); storage stays native Neo4j * `Date`/`DateTime` because writes flow through the standard * `AbstractService.createFromDTO`/`putFromDTO` path, which auto-casts — * no custom Cypher is involved. * * Unknown descriptor types fall back to `{ type: "string" }`. The field's * catalog description is carried through when present. */ export declare function descriptorFieldToJsonSchema(field: { type: string; description?: string; }): Record; /** * Generates dedicated per-entity MCP tools (`search_`, `get_`, * `create_`, `update_`). * * Descriptor-driven by default, env list is an optional override: when * `ConfigMcpInterface.promotedEntities` (env `MCP_PROMOTED_ENTITIES`) is * empty, every accessible type whose descriptor sets `chat.writable: true` * (mirrored onto `CatalogEntity.writable`) is promoted, in alphabetical * order. Setting the env list overrides that derivation entirely — the listed * types are promoted as given, `writable` included or not. * * Types the user cannot access (unknown type or module not granted) are * skipped: `GraphCatalogService.getEntityDetail` returns `null` for both * cases. Read tools delegate straight to the graph tool classes with the * `type` pre-bound; write tools delegate to {@link McpEntityWriteService}, * which enforces RBAC and attribute validation. */ export declare class McpPromotedToolsFactory { private readonly config; private readonly catalog; private readonly searchTool; private readonly readTool; private readonly writeService; constructor(config: ConfigService, catalog: GraphCatalogService, searchTool: SearchEntitiesTool, readTool: ReadEntityTool, writeService: McpEntityWriteService); /** * Builds the promoted per-entity tool definitions for the given user * context. * * Descriptor-driven by default: with no `MCP_PROMOTED_ENTITIES` configured, * every accessible type whose descriptor sets `chat.writable: true` is * promoted, alphabetically. A non-empty config list is an explicit override * and is used verbatim. Returns an empty array when neither source yields an * accessible type. */ build(ctx: McpUserContext): McpToolDefinition[]; /** * The default promotion set: every type the user can reach whose descriptor * declares `chat.writable: true`, sorted alphabetically so the tool list is * deterministic across boots. */ private deriveWritableTypes; private buildSearchTool; private buildGetTool; private buildCreateTool; private buildUpdateTool; private buildAttributesSchema; private buildRelationshipsSchema; private entityBlurb; private textResult; private internalError; } //# sourceMappingURL=mcp.promoted.tools.factory.d.ts.map