Skip to main content
Glama

get-typescript-patterns

Access TypeScript patterns for React Native development, including strict mode configuration, API response typing, route parameters, and reusable hooks. Use topic parameter to target specific sections.

Instructions

Get TypeScript patterns for React Native. Call this when writing types or interfaces. Covers strict mode config, model types, API response types, route param typing, props interface naming, store types, generics for reusable hooks, as const, discriminated unions, and type guards. Use topic to get a specific section only.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topicNoGet a specific section only. Available: strict-config, route-params, api-types, model-types, props-naming, store-types, generics, as-const, discriminated-unions, type-guards. Omit for full content.
compactNoIf true, returns rules only without code examples. Much shorter.

Implementation Reference

  • The `getTypescriptPatterns` function serves as the handler for the `get-typescript-patterns` tool, delegating the logic to `resolvePattern` with the predefined pattern definitions.
    export const getTypescriptPatterns = (topic?: string, compact?: boolean): string =>
      resolvePattern(pattern, topic, compact);
  • src/index.ts:215-233 (registration)
    Tool registration for `get-typescript-patterns` within the MCP server.
    server.tool(
      "get-typescript-patterns",
      "Get TypeScript patterns for React Native. Call this when writing types or interfaces. Covers strict mode config, model types, API response types, route param typing, props interface naming, store types, generics for reusable hooks, as const, discriminated unions, and type guards. Use `topic` to get a specific section only.",
      {
        topic: z
          .string()
          .optional()
          .describe(
            "Get a specific section only. Available: strict-config, route-params, api-types, model-types, props-naming, store-types, generics, as-const, discriminated-unions, type-guards. 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: getTypescriptPatterns(topic, compact) }],
      })
    );
  • Input schema definition (parameters `topic` and `compact`) for the `get-typescript-patterns` tool.
    {
      topic: z
        .string()
        .optional()
        .describe(
          "Get a specific section only. Available: strict-config, route-params, api-types, model-types, props-naming, store-types, generics, as-const, discriminated-unions, type-guards. Omit for full content."
        ),
      compact: z
        .boolean()
        .optional()
        .describe("If true, returns rules only without code examples. Much shorter."),
    },

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