Skip to main content
Glama

get-state-patterns

Retrieve state management patterns for React Native Expo projects using Zustand with MMKV persistence. Learn store setup, selectors, and organization rules for global state.

Instructions

Get state management patterns (Zustand + MMKV). Call this when creating a store or working with global state. Covers Zustand store setup, MMKV persistence adapter, selectors, useShallow, getState() for outside React, and store organization rules. Use topic to get a specific section only.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topicNoGet a specific section only. Available: zustand, mmkv, mmkv-adapter, store-pattern, selectors, use-shallow, get-state, organization. Omit for full content.
compactNoIf true, returns rules only without code examples. Much shorter.

Implementation Reference

  • The handler function that executes the `get-state-patterns` tool logic by calling the `resolvePattern` helper.
    export const getStatePatterns = (topic?: string, compact?: boolean): string =>
      resolvePattern(pattern, topic, compact);
  • Tool definition and schema validation for `get-state-patterns` in `src/index.ts`.
    server.tool(
      "get-state-patterns",
      "Get state management patterns (Zustand + MMKV). Call this when creating a store or working with global state. Covers Zustand store setup, MMKV persistence adapter, selectors, useShallow, getState() for outside React, and store organization rules. Use `topic` to get a specific section only.",
      {
        topic: z
          .string()
          .optional()
          .describe(
            "Get a specific section only. Available: zustand, mmkv, mmkv-adapter, store-pattern, selectors, use-shallow, get-state, organization. Omit for full content."
          ),
        compact: z
          .boolean()
          .optional()
          .describe("If true, returns rules only without code examples. Much shorter."),
      },
      async ({ topic, compact }) => ({
        content: [{ type: "text", text: getStatePatterns(topic, compact) }],
      })
    );
  • src/index.ts:100-101 (registration)
    Tool registration for `get-state-patterns` within the `McpServer` instance.
    server.tool(
      "get-state-patterns",

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/ZaharGusyatin/react-native-expo-mcp'

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