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
import { PlayFab, PlayFabProfileAPI } from "../../config/playfab.js";
import { callPlayFabApi, addCustomTags } from "../../utils/playfab-wrapper.js";
export async function GetTitlePlayerAccountIdsFromPlayFabIds(params: any) {
// Normalize input to array
const playFabIds = Array.isArray(params.PlayFabIds)
? params.PlayFabIds
: [params.PlayFabIds];
if (playFabIds.length === 0) {
throw new Error("No PlayFabIds provided");
}
const request = addCustomTags({
TitleId: PlayFab.settings.titleId,
MasterPlayerAccountIds: playFabIds
});
const result = await callPlayFabApi(
PlayFabProfileAPI.GetTitlePlayersFromMasterPlayerAccountIds,
request,
'GetTitlePlayersFromMasterPlayerAccountIds'
);
const accounts = result.TitlePlayerAccounts || {};
const mappings = [];
const notFound = [];
for (const playFabId of playFabIds) {
const account = accounts[playFabId];
if (account && account.Id) {
mappings.push({
playFabId: playFabId,
titlePlayerAccountId: account.Id,
entityType: account.Type || 'title_player_account'
});
} else {
notFound.push(playFabId);
}
}
return {
success: true,
mappings: mappings,
notFound: notFound,
totalRequested: playFabIds.length,
totalFound: mappings.length
};
}