Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
"posttest": "yarn lint",
"prepack": "yarn build && oclif readme --multi",
"pretest": "yarn format:check",
"test": "mocha test/*.ts \"src/**/*.test.ts\" && yarn workspace @devcycle/mcp-worker test",
"test:ci": "mocha --forbid-only test/*.ts \"src/**/*.test.ts\" && yarn workspace @devcycle/mcp-worker test",
"test": "mocha -r ts-node/register test/*.ts \"src/**/*.test.ts\" && yarn workspace @devcycle/mcp-worker test",
"test:ci": "mocha --forbid-only -r ts-node/register test/*.ts \"src/**/*.test.ts\" && yarn workspace @devcycle/mcp-worker test",
"test:update-snapshots": "UPDATE_SNAPSHOT=1 yarn test",
"version": "oclif readme --multi && git add README.md"
},
Expand Down
6 changes: 5 additions & 1 deletion src/mcp/tools/selfTargetingTools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ export async function updateSelfTargetingIdentityHandler(
return await handleZodiosValidationErrors(
() =>
updateUserProfile(authToken, projectKey, {
dvcUserId: args.dvc_user_id,
dvcUserId:
typeof args.dvc_user_id === 'string' &&
args.dvc_user_id.trim() === ''
? null
: args.dvc_user_id,
}),
'updateUserProfile',
)
Expand Down
1 change: 0 additions & 1 deletion src/mcp/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,6 @@ export const UpdateFeatureStatusArgsSchema = z.object({
export const UpdateSelfTargetingIdentityArgsSchema = z.object({
dvc_user_id: z
.string()
.nullable()
.describe(
'DevCycle User ID for self-targeting (use null or empty string to clear)',
),
Expand Down
7 changes: 3 additions & 4 deletions src/mcp/utils/api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,11 @@ describe('DevCycleApiClient', () => {

// Create a proper mock Zodios error with data property
class ZodiosValidationError extends Error {
constructor(
message: string,
public data: any,
) {
public data: unknown
constructor(message: string, data: unknown) {
super(message)
this.name = 'ZodiosValidationError'
this.data = data
}
}

Expand Down