debug
This commit is contained in:
parent
ebf05f8cb8
commit
faf5d1f5eb
1 changed files with 5 additions and 6 deletions
|
|
@ -160,12 +160,6 @@ func (c *Client) GetDialogs(args DialogsArguments) (*mcp.ToolResponse, error) {
|
||||||
return nil, errors.Wrap(err, "failed to get dialogs")
|
return nil, errors.Wrap(err, "failed to get dialogs")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert response to JSON
|
|
||||||
jsonData, err := json.Marshal(result)
|
|
||||||
if err != nil {
|
|
||||||
return nil, errors.Wrap(err, "failed to marshal response")
|
|
||||||
}
|
|
||||||
|
|
||||||
sort.Slice(result, func(i, j int) bool {
|
sort.Slice(result, func(i, j int) bool {
|
||||||
return result[i].LastMessageID > result[j].LastMessageID
|
return result[i].LastMessageID > result[j].LastMessageID
|
||||||
})
|
})
|
||||||
|
|
@ -174,6 +168,11 @@ func (c *Client) GetDialogs(args DialogsArguments) (*mcp.ToolResponse, error) {
|
||||||
result = result[:args.Limit]
|
result = result[:args.Limit]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
jsonData, err := json.Marshal(result)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.Wrap(err, "failed to marshal response")
|
||||||
|
}
|
||||||
|
|
||||||
return mcp.NewToolResponse(mcp.NewTextContent(string(jsonData))), nil
|
return mcp.NewToolResponse(mcp.NewTextContent(string(jsonData))), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue