fix(mcp): Add namespace fields to EntityInput and RelationInput DTOs to fix test regression
This commit is contained in:
1 parent
e006ef1220
commit
9f00d8298f
2 files changed
+53
-16
No files matched your search
+23
-5
@@ -2,18 +2,36 @@ use schemars::JsonSchema;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// Create new entities in the knowledge graph. Note: entity_type MUST ALWAYS be PascalCase (e.g. DatabaseTable, McpTool, File).
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct EntityInput {
|
||||
pub name: String,
|
||||
pub entity_type: String,
|
||||
#[serde(default)]
|
||||
pub observations: Vec<String>,
|
||||
#[serde(default)]
|
||||
pub namespace: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct CreateEntitiesTool {
|
||||
/// Array of entities to create.
|
||||
pub entities: Vec<crate::models::Entity>,
|
||||
pub entities: Vec<EntityInput>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct RelationInput {
|
||||
pub from: String,
|
||||
pub to: String,
|
||||
pub relation_type: String,
|
||||
#[serde(default)]
|
||||
pub namespace: Option<String>,
|
||||
}
|
||||
|
||||
/// Create new relations between entities in the knowledge graph.
|
||||
/// Create new relations between entities in the knowledge graph.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct CreateRelationsTool {
|
||||
/// Array of relations to create. Each relation item MUST use 'from', 'to', and 'relation_type'.
|
||||
pub relations: Vec<crate::models::Relation>,
|
||||
/// Array of relations to create.
|
||||
pub relations: Vec<RelationInput>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
@@ -57,7 +75,7 @@ pub struct DeleteObservationsTool {
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct DeleteRelationsTool {
|
||||
/// Array of relations to delete.
|
||||
pub relations: Vec<crate::models::Relation>,
|
||||
pub relations: Vec<RelationInput>,
|
||||
}
|
||||
|
||||
/// Read the entire knowledge graph. WARNING: For large graphs, use search_nodes or pagination (limit, offset) to avoid context limits.
|
||||
|
||||
Reference in new issue
Block a user