metal-kompanion/src/mcp/ToolSchemas.json

481 lines
13 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://kompanion.local/schemas/kompanion-tools.schema.json",
"title": "Kompanion MCP Tool Manifest",
"description": "Defines the tools exported by the Kompanion memory daemon.",
"type": "object",
"properties": {
"tools": {
"type": "object",
"additionalProperties": {
"type": "object",
"properties": {
"description": {
"type": "string"
},
"input": {
"$ref": "#/$defs/jsonSchema"
},
"output": {
"$ref": "#/$defs/jsonSchema"
}
},
"required": [
"description",
"input",
"output"
],
"additionalProperties": false
}
}
},
"required": [
"tools"
],
"additionalProperties": false,
"$defs": {
"stringList": {
"type": "array",
"items": {
"type": "string"
}
},
"jsonSchema": {
"type": "object",
"description": "A JSON Schema fragment describing tool input or output."
}
},
"examples": [
{
"tools": {
"save_context": {
"description": "Persist context payload in the namespace-backed memory store.",
"input": {
"type": "object",
"properties": {
"namespace": {
"type": "string"
},
"key": {
"type": "string"
},
"content": {},
"tags": {
"$ref": "#/$defs/stringList"
},
"ttl_seconds": {
"type": "integer"
}
},
"required": [
"namespace",
"content"
],
"additionalProperties": false
},
"output": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"created_at": {
"type": "string"
}
},
"required": [
"id",
"created_at"
],
"additionalProperties": false
}
},
"recall_context": {
"description": "Recall stored context entries filtered by key, tags, and time window.",
"input": {
"type": "object",
"properties": {
"namespace": {
"type": "string"
},
"key": {
"type": "string"
},
"tags": {
"$ref": "#/$defs/stringList"
},
"newest_first": {
"type": "boolean"
},
"limit": {
"type": "integer"
},
"offset": {
"type": "integer"
},
"min_timestamp": {
"type": "string"
},
"max_timestamp": {
"type": "string"
}
},
"required": [
"namespace"
],
"additionalProperties": false
},
"output": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"key": {
"type": "string"
},
"content": {},
"tags": {
"$ref": "#/$defs/stringList"
},
"created_at": {
"type": "string"
}
},
"required": [
"id",
"content",
"created_at"
],
"additionalProperties": false
}
}
},
"required": [
"items"
],
"additionalProperties": false
}
},
"embed_text": {
"description": "Return embedding vectors for provided text inputs.",
"input": {
"type": "object",
"properties": {
"namespace": {
"type": "string"
},
"model": {
"type": "string"
},
"texts": {
"$ref": "#/$defs/stringList"
}
},
"required": [
"namespace",
"texts"
],
"additionalProperties": false
},
"output": {
"type": "object",
"properties": {
"model": {
"type": "string"
},
"vectors": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "number"
}
}
}
},
"required": [
"model",
"vectors"
],
"additionalProperties": false
}
},
"upsert_memory": {
"description": "Upsert semantic memory items with optional precomputed embeddings.",
"input": {
"type": "object",
"properties": {
"namespace": {
"type": "string"
},
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"text": {
"type": "string"
},
"metadata": {
"type": "object"
},
"embedding": {
"type": "array",
"items": {
"type": "number"
}
}
},
"required": [
"text"
],
"additionalProperties": false
}
}
},
"required": [
"namespace",
"items"
],
"additionalProperties": false
},
"output": {
"type": "object",
"properties": {
"upserted": {
"type": "integer"
}
},
"required": [
"upserted"
],
"additionalProperties": false
}
},
"search_memory": {
"description": "Hybrid semantic search across stored memory chunks.",
"input": {
"type": "object",
"properties": {
"namespace": {
"type": "string"
},
"query": {
"type": "object",
"properties": {
"text": {
"type": "string"
},
"embedding": {
"type": "array",
"items": {
"type": "number"
}
},
"k": {
"type": "integer"
},
"filter": {
"type": "object"
}
},
"required": [
"text"
],
"additionalProperties": false
}
},
"required": [
"namespace",
"query"
],
"additionalProperties": false
},
"output": {
"type": "object",
"properties": {
"matches": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"score": {
"type": "number"
},
"text": {
"type": "string"
},
"metadata": {
"type": "object"
}
},
"required": [
"id",
"score"
],
"additionalProperties": false
}
}
},
"required": [
"matches"
],
"additionalProperties": false
}
},
"warm_cache": {
"description": "Queue embedding warm-up jobs for recent namespace items.",
"input": {
"type": "object",
"properties": {
"namespace": {
"type": "string"
},
"since": {
"type": "string"
}
},
"required": [
"namespace"
],
"additionalProperties": false
},
"output": {
"type": "object",
"properties": {
"queued": {
"type": "integer"
}
},
"required": [
"queued"
],
"additionalProperties": false
}
},
"kom.local.v1.backup.export_encrypted": {
"description": "Queue an encrypted backup export for the requested namespaces.",
"input": {
"type": "object",
"properties": {
"namespaces": {
"$ref": "#/$defs/stringList"
},
"destination": {
"type": "string"
}
},
"required": [
"namespaces",
"destination"
],
"additionalProperties": false
},
"output": {
"type": "object",
"properties": {
"status": {
"type": "string"
},
"artifact": {
"type": "string"
}
},
"required": [
"status",
"artifact"
],
"additionalProperties": false
}
},
"kom.local.v1.backup.import_encrypted": {
"description": "Import an encrypted backup artifact back into the local store.",
"input": {
"type": "object",
"properties": {
"source": {
"type": "string"
}
},
"required": [
"source"
],
"additionalProperties": false
},
"output": {
"type": "object",
"properties": {
"status": {
"type": "string"
}
},
"required": [
"status"
],
"additionalProperties": false
}
},
"kom.meta.v1.project_snapshot": {
"description": "Produce a high-level project status snapshot for downstream MCP clients.",
"input": {
"type": "object",
"properties": {
"includeGitStatus": {
"type": "boolean"
}
},
"required": [],
"additionalProperties": false
},
"output": {
"type": "object",
"properties": {
"sections": {
"type": "array",
"items": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"body": {
"type": "string"
}
},
"required": [
"title",
"body"
],
"additionalProperties": false
}
},
"pg_dsn": {
"type": "string"
},
"notes": {
"type": "string"
}
},
"required": [
"sections"
],
"additionalProperties": false
}
}
}
}
]
}