Skip to main content
Glama

mcp-google-sheets

find-user.ts1.18 kB
import { createAction, Property } from '@activepieces/pieces-framework'; import { githubAuth } from '../../index'; import { githubApiCall } from '../common'; import { HttpError, HttpMethod } from '@activepieces/pieces-common'; import { HttpStatusCode } from 'axios'; export const githubFindUserAction = createAction({ auth: githubAuth, name: 'find_user', displayName: 'Find User', description: 'Finds a user by their login name.', props: { username: Property.ShortText({ displayName: 'Username', description: 'The GitHub username (login) to look up.', required: true, }), }, async run({ auth, propsValue }) { const { username } = propsValue; try { const response = await githubApiCall({ accessToken: auth.access_token, method: HttpMethod.GET, resourceUri: `/users/${username}`, }); return { found: true, result: response.body, }; } catch (e) { const status = (e as HttpError).response.status; if (status === HttpStatusCode.NotFound) { return { found: false, result: {}, }; } throw e; } }, });

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/activepieces/activepieces'

If you have feedback or need assistance with the MCP directory API, please join our Discord server