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
| Name | Required | Description | Default |
|---|---|---|---|
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,
- src/handlers/player/index.ts:1-1 (registration)Re-export of the handler from the player handlers index file.export { GetAllSegments } from "./get-all-segments.js";