Skip to content

Commit e7b6742

Browse files
authored
Limit profile data returned to prevent from context window blow up (#87)
1 parent 42cfe6b commit e7b6742

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tools/get_profiles.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ func GetProfilesHandler(ctx context.Context, arguments GetProfileHandlerArgs) (*
3333
if err != nil {
3434
return nil, fmt.Errorf("error getting profiles: %v", err)
3535
}
36+
37+
if len(body) > 200000 {
38+
return nil, fmt.Errorf("response too large, please refine your query to get a smaller response")
39+
}
40+
3641
return mcpgolang.NewToolResponse(mcpgolang.NewTextContent(fmt.Sprintf("%s", string(body)))), nil
3742
}
3843

0 commit comments

Comments
 (0)