Skip to main content
Glama

get-api-patterns

Retrieve API and data fetching patterns for React Native Expo projects, including Axios client setup, service organization, and TanStack Query hooks. Use topic parameter to access specific sections like query keys or mutation hooks.

Instructions

Get API and data fetching patterns (Axios + TanStack Query). Call this when creating API services or data fetching hooks. Covers Axios client with interceptors, domain-grouped services, custom query/mutation hooks, query key conventions, and QueryClient config. Use topic to get a specific section only.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topicNoGet a specific section only. Available: axios-client, services, query-hooks, mutation-hooks, usage, v4-vs-v5, query-keys, query-client-config, rules. Omit for full content.
compactNoIf true, returns rules only without code examples. Much shorter.

Implementation Reference

  • The handler function that retrieves API patterns based on the requested topic and whether a compact version is needed.
    export const getApiPatterns = (topic?: string, compact?: boolean): string =>
      resolvePattern(pattern, topic, compact);
  • src/index.ts:123-141 (registration)
    The registration of the `get-api-patterns` tool in the MCP server.
    server.tool(
      "get-api-patterns",
      "Get API and data fetching patterns (Axios + TanStack Query). Call this when creating API services or data fetching hooks. Covers Axios client with interceptors, domain-grouped services, custom query/mutation hooks, query key conventions, and QueryClient config. Use `topic` to get a specific section only.",
      {
        topic: z
          .string()
          .optional()
          .describe(
            "Get a specific section only. Available: axios-client, services, query-hooks, mutation-hooks, usage, v4-vs-v5, query-keys, query-client-config, rules. 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: getApiPatterns(topic, compact) }],
      })
    );
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It does well by describing what content is covered (Axios client with interceptors, domain-grouped services, custom query/mutation hooks, etc.) and mentions the 'compact' parameter's effect on output length. However, it doesn't disclose potential limitations like response size or format details.

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

Conciseness5/5

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

The description is efficiently structured with three sentences that each earn their place: purpose statement, usage guidance, and parameter context. It's front-loaded with the core purpose and contains zero wasted words or redundant information.

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

Completeness4/5

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

For a read-only informational tool with 2 optional parameters and 100% schema coverage, the description is quite complete. It covers purpose, usage context, and parameter semantics. The main gap is the lack of output schema, so the agent doesn't know the return format, but the description compensates somewhat by describing content scope.

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

Parameters4/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 well. The description adds value by explaining the 'topic' parameter's purpose ('to get a specific section only') and listing available sections, and mentions the 'compact' parameter's effect ('returns rules only without code examples'). This provides useful context beyond the schema's technical descriptions.

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

Purpose5/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 API and data fetching patterns (Axios + TanStack Query)' - a specific verb ('Get') and resource ('API and data fetching patterns') with technology scope. It distinguishes from siblings like 'get-component-patterns' and 'get-typescript-patterns' by focusing specifically on API/data fetching patterns.

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

Usage Guidelines5/5

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

Explicit guidance is provided: 'Call this when creating API services or data fetching hooks.' This tells the agent exactly when to use this tool versus alternatives. The description also mentions using the 'topic' parameter for specific sections, providing additional usage context.

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