-
Notifications
You must be signed in to change notification settings - Fork 9
feat(credential-requests): Add implementation of the credential requests endpoints #35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Patrik Simek (patriksimek)
merged 13 commits into
main
from
add-credential-requests-endpoints
Mar 7, 2026
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
4967849
Add implementation of the credential requests endpoints
winterworks e9fd1dc
Merge branch 'main' into add-credential-requests-endpoints
winterworks c754652
Add the mcp config for the new credential requests
winterworks c5bb8a5
Improve imports, exports and ordering
winterworks 833d310
Add tests for credential requests endpoints
winterworks 7eebae7
Remove unused import
winterworks 4ec8184
Add endpoints, tests and mcp setup for create credential requests act…
winterworks 00ac82b
Add the credential requests detail endpoint
winterworks 8396a15
Improve the mcp endpoint descriptions
winterworks 556ea3e
Remove get credential request endpoint and update descriptions
winterworks 0272b67
Refactor delete credential request endpoint to remove confirmed optio…
winterworks 4961059
Update delete credential request test to include confirmed query para…
winterworks 0bc84cb
Update delete credential request method documentation to clarify dele…
winterworks File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,248 @@ | ||
| import type { Make } from '../make.js'; | ||
| import type { JSONValue } from '../types.js'; | ||
|
|
||
| export const tools = [ | ||
| { | ||
| name: 'credential_requests_list', | ||
| title: 'List credential requests', | ||
| description: | ||
| 'Retrieve a list of credential requests with optional filtering and pagination. Use this to view pending authorization requests, track credential request history, or find specific requests.', | ||
| category: 'credential-requests', | ||
| scope: 'credential-requests:read', | ||
| identifier: 'teamId', | ||
| annotations: { | ||
| readOnlyHint: true, | ||
| }, | ||
| inputSchema: { | ||
| type: 'object', | ||
| properties: { | ||
| teamId: { type: 'number', description: 'Filter by team ID' }, | ||
| userId: { type: 'number', description: 'Filter by user ID' }, | ||
| makeProviderId: { | ||
| type: ['string', 'number'], | ||
| description: 'Filter by Make provider ID', | ||
| }, | ||
| status: { type: 'string', description: 'Filter by status' }, | ||
| name: { type: 'string', description: 'Filter by name' }, | ||
| }, | ||
| }, | ||
| execute: async ( | ||
| make: Make, | ||
| args: { | ||
| teamId?: number; | ||
| userId?: number; | ||
| makeProviderId?: string | number; | ||
| status?: string; | ||
| name?: string; | ||
| }, | ||
| ) => { | ||
| return await make.credentialRequests.list({ | ||
| teamId: args.teamId, | ||
| userId: args.userId, | ||
| makeProviderId: args.makeProviderId, | ||
| status: args.status, | ||
| name: args.name, | ||
| cols: ['*'], | ||
| }); | ||
| }, | ||
| }, | ||
| { | ||
| name: 'credential_requests_get_detail', | ||
|
winterworks marked this conversation as resolved.
|
||
| title: 'Get credential request detail', | ||
| description: | ||
| 'Retrieve detailed information about a specific credential request by its ID, including all associated credentials with their authorization status, provider configuration, and user details.', | ||
| category: 'credential-requests', | ||
| scope: 'credential-requests:read', | ||
| identifier: 'requestId', | ||
| annotations: { | ||
| readOnlyHint: true, | ||
| }, | ||
| inputSchema: { | ||
| type: 'object', | ||
| properties: { | ||
| requestId: { type: 'string', description: 'The credential request ID to get details for' }, | ||
| }, | ||
| required: ['requestId'], | ||
| }, | ||
| execute: async (make: Make, args: { requestId: string }) => { | ||
| return await make.credentialRequests.getDetail(args.requestId); | ||
| }, | ||
| }, | ||
| { | ||
| name: 'credential_requests_create', | ||
| title: 'Create credential request', | ||
| description: | ||
| 'Create a new credential request to obtain user authorization for accessing external services. When setting up scenarios or connections programmatically, this endpoint generates an authorization URL that users can visit to grant permissions.', | ||
| category: 'credential-requests', | ||
| scope: 'credential-requests:write', | ||
| identifier: 'teamId', | ||
| annotations: { | ||
| idempotentHint: true, | ||
| destructiveHint: false, | ||
| }, | ||
| inputSchema: { | ||
| type: 'object', | ||
| properties: { | ||
| name: { type: 'string', description: 'Name of the request' }, | ||
| teamId: { type: 'number', description: 'Team ID' }, | ||
| description: { type: 'string', description: 'Description of the request' }, | ||
| connections: { | ||
| type: 'array', | ||
| items: { type: 'object' }, | ||
| description: 'Array of connections to include in the request', | ||
| }, | ||
| keys: { | ||
| type: 'array', | ||
| items: { type: 'object' }, | ||
| description: 'Array of keys to include in the request', | ||
| }, | ||
| provider: { type: 'object', description: 'Provider information' }, | ||
| }, | ||
| required: ['name', 'teamId', 'provider'], | ||
| }, | ||
| execute: async ( | ||
| make: Make, | ||
| args: { | ||
| name: string; | ||
| teamId: number; | ||
| description?: string; | ||
| connections?: Record<string, JSONValue>[]; | ||
| keys?: Record<string, JSONValue>[]; | ||
| provider: Record<string, JSONValue>; | ||
| }, | ||
| ) => { | ||
| return await make.credentialRequests.create(args); | ||
| }, | ||
| }, | ||
| { | ||
| name: 'credential_requests_delete', | ||
| title: 'Delete credential request', | ||
| description: 'Delete a credential request and all associated credentials (connections and keys) by ID.', | ||
| category: 'credential-requests', | ||
| scope: 'credential-requests:write', | ||
| identifier: 'requestId', | ||
| annotations: { | ||
| destructiveHint: true, | ||
| }, | ||
| inputSchema: { | ||
| type: 'object', | ||
| properties: { | ||
| requestId: { type: 'string', description: 'The credential request ID to delete' }, | ||
| }, | ||
| required: ['requestId'], | ||
| }, | ||
| execute: async (make: Make, args: { requestId: string }) => { | ||
| await make.credentialRequests.delete(args.requestId); | ||
| return 'Credential request and associated credentials have been deleted.'; | ||
| }, | ||
| }, | ||
| { | ||
| name: 'credential_requests_get_credential', | ||
| title: 'Get credential', | ||
| description: | ||
| 'Get details of a specific credential by ID. Returns metadata about the credential including its authorization status, associated request, and timestamps.', | ||
| category: 'credential-requests', | ||
| scope: 'credential-requests:read', | ||
| identifier: 'credentialId', | ||
| annotations: { | ||
| readOnlyHint: true, | ||
| }, | ||
| inputSchema: { | ||
| type: 'object', | ||
| properties: { | ||
| credentialId: { type: 'string', description: 'The credential ID to get' }, | ||
| }, | ||
| required: ['credentialId'], | ||
| }, | ||
| execute: async (make: Make, args: { credentialId: string }) => { | ||
| return await make.credentialRequests.getCredential(args.credentialId, { cols: ['*'] }); | ||
| }, | ||
| }, | ||
| { | ||
| name: 'credential_requests_decline_credential', | ||
| title: 'Decline credential', | ||
| description: | ||
| 'Decline a credential authorization request by ID with an optional reason. The credential status will be updated to declined.', | ||
| category: 'credential-requests', | ||
| scope: 'credential-requests:write', | ||
| identifier: 'credentialId', | ||
| annotations: { | ||
| idempotentHint: true, | ||
| destructiveHint: true, | ||
| }, | ||
| inputSchema: { | ||
| type: 'object', | ||
| properties: { | ||
| credentialId: { type: 'string', description: 'The credential ID to decline' }, | ||
| reason: { type: 'string', description: 'Optional reason for declining' }, | ||
| }, | ||
| required: ['credentialId'], | ||
| }, | ||
| execute: async (make: Make, args: { credentialId: string; reason?: string }) => { | ||
| return await make.credentialRequests.declineCredential(args.credentialId, args.reason); | ||
| }, | ||
| }, | ||
| { | ||
| name: 'credential_requests_delete_credential', | ||
| title: 'Delete credential', | ||
| description: | ||
| 'Delete a credential (e.g., revoke OAuth tokens) and reset its state to pending. This allows the credential to be re-authorized with fresh permissions.', | ||
| category: 'credential-requests', | ||
| scope: 'credential-requests:write', | ||
| identifier: 'credentialId', | ||
| annotations: { | ||
| idempotentHint: true, | ||
| destructiveHint: true, | ||
| }, | ||
| inputSchema: { | ||
| type: 'object', | ||
| properties: { | ||
| credentialId: { type: 'string', description: 'The credential ID to delete' }, | ||
| }, | ||
| required: ['credentialId'], | ||
| }, | ||
| execute: async (make: Make, args: { credentialId: string }) => { | ||
| return await make.credentialRequests.deleteCredential(args.credentialId); | ||
| }, | ||
| }, | ||
| { | ||
| name: 'credential_requests_create_action', | ||
| title: 'Create credential action', | ||
| description: | ||
| 'Create a credential request action directly for the current user, bypassing the typical creation flow.', | ||
| category: 'credential-requests', | ||
| scope: 'credential-requests:write', | ||
| identifier: 'teamId', | ||
| annotations: { | ||
| idempotentHint: true, | ||
| destructiveHint: false, | ||
| }, | ||
| inputSchema: { | ||
| type: 'object', | ||
| properties: { | ||
| teamId: { type: 'number', description: 'Team ID' }, | ||
| accountName: { type: 'string', description: 'Account name' }, | ||
| scopes: { | ||
| type: 'array', | ||
| items: { type: 'string' }, | ||
| description: 'OAuth scopes', | ||
| }, | ||
| }, | ||
| required: ['teamId', 'accountName', 'scopes'], | ||
| }, | ||
| execute: async ( | ||
| make: Make, | ||
| args: { | ||
| teamId: number; | ||
| accountName: string; | ||
| scopes: string[]; | ||
| }, | ||
| ) => { | ||
| return await make.credentialRequests.createAction({ | ||
| ...args, | ||
| connections: [], // Add appropriate connections here | ||
| keys: [], // Add appropriate keys here | ||
| }); | ||
| }, | ||
| }, | ||
| ]; | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.