Skip to main content
Glama

get_all_segments

Retrieve all segments from your Azure Cosmos DB using natural language queries through the PlayFab MCP Server, simplifying data interaction for AI assistants.

Instructions

PlayFab get all segments

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function implementing the get_all_segments tool. It calls the PlayFab Admin API's GetAllSegments method, transforms the response segments, and returns them.
    export const GetAllSegments: PlayFabHandler<GetAllSegmentsParams, GetAllSegmentsResult> = async (_params) => { const request = addCustomTags({}); const result = await callAdminAPI<PlayFabAdminModels.GetAllSegmentsRequest, PlayFabAdminModels.GetAllSegmentsResult>( PlayFabAdminAPI.GetAllSegments, request, 'GetAllSegments' ); const transformedSegments: Array<{ Id: string; Name: string; Description?: string }> = (result.Segments || []).map(segment => ({ Id: segment.Id || '', Name: segment.Name || '', Description: (segment as any).Description })); return { success: true, segments: transformedSegments }; };
  • MCP Tool schema definition for get_all_segments, including name, description, and empty input schema.
    export const GET_ALL_SEGMENTS_TOOL: Tool = { name: "get_all_segments", description: "Retrieves an array of player segment definitions. " + "Results from this can be used in subsequent API calls " + "such as GetPlayersInSegment which requires a Segment ID. " + "While segment names can change the ID for that segment will not change.", inputSchema: { type: "object", properties: {}, required: [], }, }
  • src/server.ts:61-61 (registration)
    Registration of the get_all_segments handler in the router for tool execution.
    'get_all_segments': playerHandlers.GetAllSegments as any,
  • src/server.ts:110-110 (registration)
    Registration of the get_all_segments tool in the ListTools response.
    playerTools.GET_ALL_SEGMENTS_TOOL,
  • Re-export of the handler from the player handlers index file.
    export { GetAllSegments } from "./get-all-segments.js";

Other Tools

Related Tools

Latest Blog Posts

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/akiojin/playfab-mcp-server'

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