/**
* Dependency guidance for Monica MCP tools
* Helps LLMs understand tool prerequisites and sequencing
*/
export const TOOL_DEPENDENCIES = {
// Tools that need a contact ID
contactId: {
description: "Requires a contact ID from an existing contact",
prerequisiteTool: "monica_manage_contact",
prerequisiteAction: "create",
alternativeTools: ["monica_search_contacts"],
example: "First create a contact or search for existing contacts to get a contactId"
},
// Tools that need a contact field type ID
contactFieldTypeId: {
description: "Requires a contact field type ID",
prerequisiteTool: "monica_manage_contact_field_type",
prerequisiteAction: "create or list",
example: "Use monica_manage_contact_field_type with action 'list' to see available field types, or 'create' to make a new one"
},
// Tools that need an activity type category ID
activityTypeCategoryId: {
description: "Requires an activity type category ID",
prerequisiteTool: "monica_manage_activity_type_category",
prerequisiteAction: "create or list",
example: "Use monica_manage_activity_type_category with action 'list' to see available categories, or 'create' to make a new one"
},
// Tools that need an activity type ID
activityTypeId: {
description: "Requires an activity type ID",
prerequisiteTool: "monica_manage_activity_type",
prerequisiteAction: "create or list",
example: "Use monica_manage_activity_type with action 'list' to see available activity types, or 'create' to make a new one"
}
} as const;
export function getDependencyGuidance(missingField: string): string {
const guidance = TOOL_DEPENDENCIES[missingField as keyof typeof TOOL_DEPENDENCIES];
if (!guidance) {
return `Missing required field: ${missingField}`;
}
return `Missing ${missingField}: ${guidance.description}. ${guidance.example}`;
}