@kevinwatt/mcp-webhook
Version:
Generic Webhook MCP Server
25 lines (24 loc) • 769 B
JavaScript
/**
* Validates if the provided arguments are valid for sending a message
* @param args - The arguments to validate
* @returns True if arguments are valid, false otherwise
*/
export const isValidSendMessageArgs = (args) => {
if (typeof args !== 'object' || args === null) {
return false;
}
const { content } = args;
return typeof content === 'string';
};
/**
* Validates if the provided arguments are valid for sending JSON
* @param args - The arguments to validate
* @returns True if arguments are valid, false otherwise
*/
export const isValidSendJsonArgs = (args) => {
if (typeof args !== 'object' || args === null) {
return false;
}
const { body } = args;
return typeof body === 'object' && body !== null;
};