Skip to content

Commit dff40b2

Browse files
committed
update to more simple
1 parent 4390bd7 commit dff40b2

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/tools/pushFlexMessage.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ export default class PushFlexMessage extends AbstractTool {
2929

3030
server.tool(
3131
"push_flex_message",
32-
"Push a highly customizable flex message to a user via LINE. All constraints and validation rules are defined in the message schema.",
32+
"Push a highly customizable flex message to a user via LINE." +
33+
"All constraints and validation rules are defined in the message schema.",
3334
{
3435
userId: userIdSchema,
3536
message: flexMessageSchema,
@@ -46,15 +47,9 @@ export default class PushFlexMessage extends AbstractTool {
4647
});
4748
return createSuccessResponse(response);
4849
} catch (error) {
49-
// Enhanced error message with debugging hints
50-
let errorMessage = `Failed to push flex message: ${error.message}`;
51-
52-
if (error.message?.includes("400")) {
53-
errorMessage +=
54-
"\n\nDEBUG HINT: Check the flex message schema constraints. Common issues: missing required properties, invalid enum values, or exceeding length limits.";
55-
}
56-
57-
return createErrorResponse(errorMessage);
50+
return createErrorResponse(
51+
`Failed to push flex message: ${error.message}`,
52+
);
5853
}
5954
},
6055
);

0 commit comments

Comments
 (0)