Skip to content

Commit 70c499d

Browse files
IlyaasKclaude
andcommitted
Don't show setup hint on empty profile search
manage_profiles list with a query but no limit/offset used the full-inventory empty text ("No profiles found... use setup") even when the search simply matched nothing while other profiles exist. Pass the query through so an empty search returns a "no matches" note instead, matching the paginated path's neutral empty result. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 8a9d722 commit 70c499d

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

src/lib/mcp/tools/profiles.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,15 @@ async function listProfiles(client: KernelClient, query?: ProfileListParams) {
2525
return profiles;
2626
}
2727

28-
function fullProfileListResponse(profiles: Profile[]) {
28+
function fullProfileListResponse(profiles: Profile[], query?: string) {
2929
return itemsJsonResponse(profiles, {
3030
has_more: false,
3131
next_offset: null,
32-
emptyText:
33-
"No profiles found. Use manage_profiles with action 'setup' to create one.",
32+
// A search that matches nothing shouldn't claim the inventory is empty or
33+
// suggest setup — other profiles may exist that just don't match the query.
34+
emptyText: query
35+
? `No profiles match "${query}".`
36+
: "No profiles found. Use manage_profiles with action 'setup' to create one.",
3437
});
3538
}
3639

@@ -155,7 +158,7 @@ export function registerProfileCapabilities(server: McpServer) {
155158
client,
156159
params.query ? { query: params.query } : undefined,
157160
);
158-
return fullProfileListResponse(profiles);
161+
return fullProfileListResponse(profiles, params.query);
159162
}
160163

161164
const page = await client.profiles.list({

0 commit comments

Comments
 (0)