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",
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It describes what content the tool provides (Zustand store setup, MMKV persistence adapter, etc.) and mentions the 'compact' parameter's effect on output length. However, it doesn't disclose important behavioral aspects like response format, potential size of output, error conditions, or whether this is a read-only operation (though 'Get' implies it).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded with the core purpose. The first sentence establishes what the tool does, followed by usage guidance and parameter hints. While efficient, the second sentence could be slightly more concise by combining related concepts.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 2 parameters with 100% schema coverage but no annotations and no output schema, the description provides adequate context for a documentation/pattern retrieval tool. It covers purpose, usage context, and hints at parameter effects. However, for a tool that returns potentially complex pattern information, more detail about output format or content structure would be helpful since there's no output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters thoroughly. The description adds minimal value beyond the schema: it mentions using 'topic' to get specific sections and implies 'compact' affects content length. This meets the baseline 3 for high schema coverage, but doesn't provide significant additional parameter context.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Get state management patterns (Zustand + MMKV)' - a specific verb ('Get') and resource ('state management patterns'). It distinguishes from siblings by focusing on state management patterns rather than other topics like components, navigation, or styling. However, it doesn't explicitly contrast with similar tools like 'get-api-patterns' or 'get-component-patterns' beyond the topic difference.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear usage context: 'Call this when creating a store or working with global state.' This gives explicit guidance on when to use the tool. However, it doesn't mention when NOT to use it or provide explicit alternatives among sibling tools, though the topic specialization implies alternatives exist.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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

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