@gala-chain/launchpad-mcp-server
Version:
MCP server for Gala Launchpad - 102 tools (pool management, event watchers, GSwap DEX trading, price history, token creation, wallet management, DEX pool discovery, liquidity positions, token locks, locked token queries, composite pool data, cross-chain b
57 lines • 2.41 kB
JavaScript
;
/**
* Comments & Social Tools
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.socialTools = exports.fetchCommentsTool = exports.postCommentTool = void 0;
const response_formatter_js_1 = require("../../utils/response-formatter.js");
const error_handler_js_1 = require("../../utils/error-handler.js");
const common_schemas_js_1 = require("../../schemas/common-schemas.js");
const default_values_js_1 = require("../../utils/default-values.js");
// 1. Post Comment
exports.postCommentTool = {
name: 'gala_launchpad_post_comment',
description: 'Post a comment on a token pool',
inputSchema: {
type: 'object',
properties: {
tokenName: common_schemas_js_1.TOKEN_NAME_SCHEMA,
message: common_schemas_js_1.COMMENT_MESSAGE_SCHEMA,
privateKey: common_schemas_js_1.PRIVATE_KEY_SCHEMA,
},
required: ['tokenName', 'message'],
},
handler: (0, error_handler_js_1.withErrorHandling)(async (sdk, args) => {
await sdk.postComment({
tokenName: args.tokenName,
content: args.message, // MCP parameter "message" → SDK parameter "content"
privateKey: args.privateKey,
});
// postComment returns void, so return success message
return (0, response_formatter_js_1.formatSuccess)({ success: true, message: 'Comment posted successfully' });
}),
};
// 2. Fetch Comments (using centralized pagination defaults)
exports.fetchCommentsTool = {
name: 'gala_launchpad_fetch_comments',
description: 'Get comments for a token pool',
inputSchema: {
type: 'object',
properties: {
tokenName: common_schemas_js_1.TOKEN_NAME_SCHEMA,
page: common_schemas_js_1.PAGE_SCHEMA,
limit: (0, common_schemas_js_1.createLimitSchema)('comment', 20),
},
required: ['tokenName'],
},
handler: (0, error_handler_js_1.withErrorHandling)(async (sdk, args) => {
const pagination = (0, default_values_js_1.applyOperationPaginationDefaults)(args, 'comment');
const result = await sdk.fetchComments({
tokenName: args.tokenName,
...pagination,
});
return (0, response_formatter_js_1.formatSuccess)(result);
}),
};
exports.socialTools = [exports.postCommentTool, exports.fetchCommentsTool];
//# sourceMappingURL=index.js.map