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: 0 additions & 4 deletions src/tools/create-token-tool/CreateTokenTool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ export class CreateTokenTool extends MapboxApiBasedTool<
input: CreateTokenInput,
accessToken?: string
): Promise<{ type: 'text'; text: string }> {
if (!accessToken) {
throw new Error('MAPBOX_ACCESS_TOKEN is not set');
}

const username = MapboxApiBasedTool.getUserNameFromToken(accessToken);

this.log(
Expand Down
5 changes: 3 additions & 2 deletions src/tools/preview-style-tool/PreviewStyleTool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ export class PreviewStyleTool extends MapboxApiBasedTool<
}

protected async execute(
input: PreviewStyleInput
input: PreviewStyleInput,
accessToken?: string
): Promise<{ type: 'text'; text: string }> {
const username = MapboxApiBasedTool.getUserNameFromToken();
const username = MapboxApiBasedTool.getUserNameFromToken(accessToken);

// Get list of tokens to find a public token
const listTokensTool = new ListTokensTool();
Expand Down
Loading